Previous 15994 Revisions Next

r10319 Sunday 6th February, 2011 at 18:55:44 UTC by Miodrag Milanović
First batch of change from timer_pulse to MCFG_TIMER_ADD_PERIODIC
[src/mess/drivers]4004clk.c avigo.c bml3.c busicom.c coleco.c fk1.c glasgow.c junior.c kim1.c mephisto.c mk1.c mk2.c mpf1.c multi8.c mycom.c nanos.c nc.c pasogo.c pc6001.c pc8801.c pcw.c pcw16.c polgar.c psion.c scorpion.c smc777.c supercon.c svision.c ti89.c tk80bs.c vg5k.c vt100.c x1.c z88.c
[src/mess/machine]mboard.c mboard.h

src/mess/machine/mboard.c
r10318r10319
286286      output_set_indexed_value("Q", i, border_pieces[i]);
287287}
288288
289TIMER_CALLBACK( mboard_update_artwork )
289TIMER_DEVICE_CALLBACK( mboard_update_artwork )
290290{
291   check_board_buttons(machine);
292   set_artwork(machine);
291   check_board_buttons(timer.machine);
292   set_artwork(timer.machine);
293293   mboard_set_border_pieces();
294294}
295295
src/mess/machine/mboard.h
r10318r10319
6464WRITE32_HANDLER( mboard_write_board_32 );
6565WRITE32_HANDLER( mboard_write_LED_32 );
6666
67TIMER_CALLBACK( mboard_update_artwork );
67TIMER_DEVICE_CALLBACK( mboard_update_artwork );
6868
6969void mboard_savestate_register(running_machine *machine);
7070
src/mess/drivers/pc6001.c
r10318r10319
19611961   return joy_press;
19621962}
19631963
1964static TIMER_CALLBACK(cassette_callback)
1964static TIMER_DEVICE_CALLBACK(cassette_callback)
19651965{
1966   pc6001_state *state = machine->driver_data<pc6001_state>();
1966   pc6001_state *state = timer.machine->driver_data<pc6001_state>();
19671967   if(state->cas_switch == 1)
19681968   {
19691969      #if 0
19701970      static UINT8 cas_data_i = 0x80,cas_data_poll;
19711971      //state->cur_keycode = gfx_data[state->cas_offset++];
1972      if(cassette_input(machine->device("cass")) > 0.03)
1972      if(cassette_input(timer.machine->device("cass")) > 0.03)
19731973         cas_data_poll|= cas_data_i;
19741974      else
19751975         cas_data_poll&=~cas_data_i;
r10318r10319
19791979         cas_data_i = 0x80;
19801980         /* data ready, poll irq */
19811981         state->irq_vector = 0x08;
1982         cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE);
1982         cputag_set_input_line(timer.machine,"maincpu", 0, ASSERT_LINE);
19831983      }
19841984      else
19851985         cas_data_i>>=1;
19861986      #else
1987         UINT8 *cas_data = machine->region("cas")->base();
1987         UINT8 *cas_data = timer.machine->region("cas")->base();
19881988
19891989         state->cur_keycode = cas_data[state->cas_offset++];
19901990         popmessage("%04x %04x",state->cas_offset,state->cas_maxsize);
r10318r10319
19941994            state->cas_switch = 0;
19951995            if(IRQ_LOG) printf("Tape-E IRQ 0x12\n");
19961996            state->irq_vector = 0x12;
1997            cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE);
1997            cputag_set_input_line(timer.machine,"maincpu", 0, ASSERT_LINE);
19981998         }
19991999         else
20002000         {
20012001            if(IRQ_LOG) printf("Tape-D IRQ 0x08\n");
20022002            state->irq_vector = 0x08;
2003            cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE);
2003            cputag_set_input_line(timer.machine,"maincpu", 0, ASSERT_LINE);
20042004         }
20052005      #endif
20062006   }
20072007}
20082008
2009static TIMER_CALLBACK(keyboard_callback)
2009static TIMER_DEVICE_CALLBACK(keyboard_callback)
20102010{
2011   pc6001_state *state = machine->driver_data<pc6001_state>();
2012   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2013   UINT32 key1 = input_port_read(machine,"key1");
2014   UINT32 key2 = input_port_read(machine,"key2");
2015   UINT32 key3 = input_port_read(machine,"key3");
2016//  UINT8 p1_key = input_port_read(machine, "P1");;
2011   pc6001_state *state = timer.machine->driver_data<pc6001_state>();
2012   address_space *space = cputag_get_address_space(timer.machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2013   UINT32 key1 = input_port_read(timer.machine,"key1");
2014   UINT32 key2 = input_port_read(timer.machine,"key2");
2015   UINT32 key3 = input_port_read(timer.machine,"key3");
2016//  UINT8 p1_key = input_port_read(timer.machine, "P1");;
20172017
20182018   if(state->cas_switch == 0)
20192019   {
r10318r10319
20222022         state->cur_keycode = check_keyboard_press(space->machine);
20232023         if(IRQ_LOG) printf("KEY IRQ 0x02\n");
20242024         state->irq_vector = 0x02;
2025         cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE);
2025         cputag_set_input_line(timer.machine,"maincpu", 0, ASSERT_LINE);
20262026         state->old_key1 = key1;
20272027         state->old_key2 = key2;
20282028         state->old_key3 = key3;
r10318r10319
20342034         if(state->cur_keycode)
20352035         {
20362036            state->irq_vector = 0x16;
2037            cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE);
2037            cputag_set_input_line(timer.machine,"maincpu", 0, ASSERT_LINE);
20382038         }
20392039      }
20402040      #endif
r10318r10319
20442044static MACHINE_START(pc6001)
20452045{
20462046   pc6001_state *state = machine->driver_data<pc6001_state>();
2047   /* TODO: accurate timing on this */
2048   machine->scheduler().timer_pulse(attotime::from_hz(250), FUNC(keyboard_callback));
2049
2050   machine->scheduler().timer_pulse(attotime::from_hz(1200/12), FUNC(cassette_callback)); //1200 bauds / (1 start bit -> 8 data bits -> 3 stop bits)
2051
20522047   state->timer_hz_div = 3;
20532048   {
20542049      attotime period = attotime::from_hz((487.5*4)/(state->timer_hz_div+1));
r10318r10319
23182313   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
23192314//   MCFG_SOUND_WAVE_ADD("wave","cass")
23202315//   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
2316
2317   /* TODO: accurate timing on this */
2318   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(250))
2319   MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_callback, attotime::from_hz(1200/12)) //1200 bauds / (1 start bit -> 8 data bits -> 3 stop bits)
23212320MACHINE_CONFIG_END
23222321
23232322
src/mess/drivers/mycom.c
r10318r10319
4644640x0d,0x0d,0x38,0x28,0x49,0x69,0x4b,0x6b,0x2c,0x3c,0x39,0x39,0x36,0x36,0x33,0x33,0x12,0x12,
4654650x07,0x07,0x39,0x29,0x4f,0x6f,0x4c,0x6c,0x2e,0x3e,0x63,0x63,0x66,0x66,0x61,0x61,0x2f,0x3f };
466466
467static TIMER_CALLBACK( mycom_kbd )
467static TIMER_DEVICE_CALLBACK( mycom_kbd )
468468{
469   mycom_state *state = machine->driver_data<mycom_state>();
469   mycom_state *state = timer.machine->driver_data<mycom_state>();
470470   UINT8 x, y, scancode = 0;
471471   UINT16 pressed[9];
472472   char kbdrow[2];
473   UINT8 modifiers = input_port_read(machine, "XX");
473   UINT8 modifiers = input_port_read(timer.machine, "XX");
474474   UINT8 shift_pressed = (modifiers & 2) >> 1;
475475   state->keyb_press_flag = 0;
476476
r10318r10319
478478   for (x = 0; x < 9; x++)
479479   {
480480      sprintf(kbdrow,"X%d",x);
481      pressed[x] = (input_port_read(machine, kbdrow));
481      pressed[x] = (input_port_read(timer.machine, kbdrow));
482482   }
483483
484484   /* find what has changed */
r10318r10319
513513   state->cassette = machine->device("cassette");
514514   state->fdc = machine->device("fdc");
515515   state->RAM = machine->region("maincpu")->base();
516   machine->scheduler().timer_pulse(attotime::from_hz(20), FUNC(mycom_kbd));
517516}
518517
519518static MACHINE_RESET(mycom)
r10318r10319
570569   /* Devices */
571570   MCFG_CASSETTE_ADD( "cassette", default_cassette_config )
572571   MCFG_WD179X_ADD("fdc", wd1771_intf) // WD1771
572   
573   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", mycom_kbd, attotime::from_hz(20))
573574MACHINE_CONFIG_END
574575
575576/* ROM definition */
src/mess/drivers/x1.c
r10318r10319
674674   logerror("CMT: Command 0xe9-0x%02x received.\n",cmd);
675675}
676676
677static TIMER_CALLBACK( cmt_wind_timer )
677static TIMER_DEVICE_CALLBACK( cmt_wind_timer )
678678{
679   x1_state *state = machine->driver_data<x1_state>();
680   device_t* cmt = machine->device("cass");
679   x1_state *state = timer.machine->driver_data<x1_state>();
680   device_t* cmt = timer.machine->device("cass");
681681
682   if(cassette_get_image(machine->device("cass")) == NULL) //avoid a crash if a disk game tries to access this
682   if(cassette_get_image(timer.machine->device("cass")) == NULL) //avoid a crash if a disk game tries to access this
683683      return;
684684
685685   switch(state->cmt_current_cmd)
r10318r10319
688688      case 0x05:  // Fast Forwarding tape
689689         cassette_seek(cmt,1,SEEK_CUR);
690690         if(cassette_get_position(cmt) >= cassette_get_length(cmt))  // at end?
691            cmt_command(machine,0x01);  // Stop tape
691            cmt_command(timer.machine,0x01);  // Stop tape
692692         break;
693693      case 0x04:
694694      case 0x06:  // Rewinding tape
695695         cassette_seek(cmt,-1,SEEK_CUR);
696696         if(cassette_get_position(cmt) <= 0) // at beginning?
697            cmt_command(machine,0x01);  // Stop tape
697            cmt_command(timer.machine,0x01);  // Stop tape
698698         break;
699699   }
700700}
r10318r10319
22402240}
22412241#endif
22422242
2243static TIMER_CALLBACK(keyboard_callback)
2243static TIMER_DEVICE_CALLBACK(keyboard_callback)
22442244{
2245   x1_state *state = machine->driver_data<x1_state>();
2246   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2247   UINT32 key1 = input_port_read(machine,"key1");
2248   UINT32 key2 = input_port_read(machine,"key2");
2249   UINT32 key3 = input_port_read(machine,"key3");
2250   UINT32 key4 = input_port_read(machine,"tenkey");
2251   UINT32 f_key = input_port_read(machine, "f_keys");
2245   x1_state *state = timer.machine->driver_data<x1_state>();
2246   address_space *space = cputag_get_address_space(timer.machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2247   UINT32 key1 = input_port_read(timer.machine,"key1");
2248   UINT32 key2 = input_port_read(timer.machine,"key2");
2249   UINT32 key3 = input_port_read(timer.machine,"key3");
2250   UINT32 key4 = input_port_read(timer.machine,"tenkey");
2251   UINT32 f_key = input_port_read(timer.machine, "f_keys");
22522252
22532253   if(state->key_irq_vector)
22542254   {
r10318r10319
22582258         sub_io_w(space,0,0xe6);
22592259         state->irq_vector = state->key_irq_vector;
22602260         state->key_irq_flag = 1;
2261         cputag_set_input_line(machine,"maincpu",0,ASSERT_LINE);
2261         cputag_set_input_line(timer.machine,"maincpu",0,ASSERT_LINE);
22622262         state->old_key1 = key1;
22632263         state->old_key2 = key2;
22642264         state->old_key3 = key3;
r10318r10319
23422342static MACHINE_START( x1 )
23432343{
23442344   x1_state *state = machine->driver_data<x1_state>();
2345   machine->scheduler().timer_pulse(attotime::from_hz(240), FUNC(keyboard_callback));
2346   machine->scheduler().timer_pulse(attotime::from_hz(16), FUNC(cmt_wind_timer));
23472345
23482346   /* set up RTC */
23492347   {
r10318r10319
24442442
24452443   MCFG_FLOPPY_4_DRIVES_ADD(x1_floppy_config)
24462444   MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
2447
2445   
2446   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240))   
2447   MCFG_TIMER_ADD_PERIODIC("cmt_wind_timer", cmt_wind_timer, attotime::from_hz(16))
24482448MACHINE_CONFIG_END
24492449
24502450static MACHINE_CONFIG_DERIVED( x1turbo, x1 )
src/mess/drivers/mk1.c
r10318r10319
156156INPUT_PORTS_END
157157
158158
159static TIMER_CALLBACK( mk1_update_leds )
159static TIMER_DEVICE_CALLBACK( mk1_update_leds )
160160{
161   mk1_state *state = machine->driver_data<mk1_state>();
161   mk1_state *state = timer.machine->driver_data<mk1_state>();
162162   int i;
163163
164164   for ( i = 0; i < 4; i++ ) {
r10318r10319
171171
172172static MACHINE_START( mk1 )
173173{
174   machine->scheduler().timer_pulse(attotime::from_hz(30), FUNC(mk1_update_leds));
175174}
176175
177176
r10318r10319
202201
203202    /* video hardware */
204203   MCFG_DEFAULT_LAYOUT( layout_mk1 )
204   
205   MCFG_TIMER_ADD_PERIODIC("led_timer", mk1_update_leds, attotime::from_hz(30))
205206MACHINE_CONFIG_END
206207
207208
src/mess/drivers/kim1.c
r10318r10319
245245};
246246
247247
248static TIMER_CALLBACK( kim1_cassette_input )
248static TIMER_DEVICE_CALLBACK( kim1_cassette_input )
249249{
250   kim1_state *state = machine->driver_data<kim1_state>();
251   double tap_val = cassette_input( machine->device("cassette") );
250   kim1_state *state = timer.machine->driver_data<kim1_state>();
251   double tap_val = cassette_input( timer.machine->device("cassette") );
252252
253253   if ( tap_val <= 0 )
254254   {
r10318r10319
266266}
267267
268268
269static TIMER_CALLBACK( kim1_update_leds )
269static TIMER_DEVICE_CALLBACK( kim1_update_leds )
270270{
271   kim1_state *state = machine->driver_data<kim1_state>();
271   kim1_state *state = timer.machine->driver_data<kim1_state>();
272272   int i;
273273
274274   for ( i = 0; i < 6; i++ )
r10318r10319
287287   state_save_register_item(machine, "kim1", NULL, 0, state->u2_port_b );
288288   state_save_register_item(machine, "kim1", NULL, 0, state->_311_output );
289289   state_save_register_item(machine, "kim1", NULL, 0, state->cassette_high_count );
290   machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(kim1_update_leds));
291   machine->scheduler().timer_pulse(attotime::from_hz(44100), FUNC(kim1_cassette_input));
292290}
293291
294292
r10318r10319
339337
340338   /* video */
341339   MCFG_DEFAULT_LAYOUT( layout_kim1 )
340   
341   MCFG_TIMER_ADD_PERIODIC("update_led_timer", kim1_update_leds, attotime::from_hz(60))
342   MCFG_TIMER_ADD_PERIODIC("cassette_timer", kim1_cassette_input, attotime::from_hz(44100))
342343MACHINE_CONFIG_END
343344
344345
src/mess/drivers/glasgow.c
r10318r10319
252252   state->beeper = data;
253253}
254254
255static TIMER_CALLBACK( update_nmi )
255static TIMER_DEVICE_CALLBACK( update_nmi )
256256{
257   //cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, irq_edge & 0xff ? CLEAR_LINE : ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
258      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
259      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
257   //cputag_set_input_line_and_vector(timer.machine, "maincpu", M68K_IRQ_7, irq_edge & 0xff ? CLEAR_LINE : ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
258      cputag_set_input_line_and_vector(timer.machine, "maincpu", M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
259      cputag_set_input_line_and_vector(timer.machine, "maincpu", M68K_IRQ_7, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
260260   // irq_edge = ~irq_edge;
261261}
262262
263static TIMER_CALLBACK( update_nmi32 )
263static TIMER_DEVICE_CALLBACK( update_nmi32 )
264264{
265   // cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, irq_edge & 0xff ? CLEAR_LINE : ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
266      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
267      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
265   // cputag_set_input_line_and_vector(timer.machine, "maincpu", M68K_IRQ_7, irq_edge & 0xff ? CLEAR_LINE : ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
266      cputag_set_input_line_and_vector(timer.machine, "maincpu", M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
267      cputag_set_input_line_and_vector(timer.machine, "maincpu", M68K_IRQ_7, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
268268   // irq_edge = ~irq_edge;
269269}
270270
r10318r10319
276276   mboard_key_selector = 0;
277277   state->irq_flag = 0;
278278   state->lcd_shift_counter = 3;
279   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(update_nmi));
280   machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork));
281279   beep_set_frequency(speaker, 44);
282280
283281   mboard_savestate_register(machine);
r10318r10319
290288   device_t *speaker = machine->device("beep");
291289
292290   state->lcd_shift_counter = 3;
293   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(update_nmi32));
294   machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork));
295291   beep_set_frequency(speaker, 44);
296292
297293   mboard_savestate_register(machine);
r10318r10319
509505   MCFG_SPEAKER_STANDARD_MONO("mono")
510506   MCFG_SOUND_ADD("beep", BEEP, 0)
511507   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
508   
509   MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(50))
510   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
512511MACHINE_CONFIG_END
513512
514513static MACHINE_CONFIG_DERIVED( amsterd, glasgow )
r10318r10319
522521    MCFG_CPU_REPLACE("maincpu", M68020, 14000000)
523522    MCFG_CPU_PROGRAM_MAP(dallas32_mem)
524523    MCFG_MACHINE_START( dallas32 )
524
525   MCFG_DEVICE_REMOVE("nmi_timer")
526   MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi32, attotime::from_hz(50))
525527MACHINE_CONFIG_END
526528
527529/***************************************************************************
src/mess/drivers/smc777.c
r10318r10319
590590   PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("_")
591591INPUT_PORTS_END
592592
593static TIMER_CALLBACK( keyboard_callback )
593static TIMER_DEVICE_CALLBACK( keyboard_callback )
594594{
595   smc777_state *state = machine->driver_data<smc777_state>();
595   smc777_state *state = timer.machine->driver_data<smc777_state>();
596596   static const char *const portnames[3] = { "key1","key2","key3" };
597597   int i,port_i,scancode;
598   //UINT8 keymod = input_port_read(machine,"key_modifiers") & 0x1f;
598   //UINT8 keymod = input_port_read(timer.machine,"key_modifiers") & 0x1f;
599599   scancode = 0;
600600
601601   for(port_i=0;port_i<3;port_i++)
602602   {
603603      for(i=0;i<32;i++)
604604      {
605         if((input_port_read(machine,portnames[port_i])>>i) & 1)
605         if((input_port_read(timer.machine,portnames[port_i])>>i) & 1)
606606         {
607607            //key_flag = 1;
608608//              if(keymod & 0x02)  // shift not pressed
r10318r10319
636636
637637   for(i=0;i<0x4000;i++)
638638      state->wram[i] = rom[i];
639
640   machine->scheduler().timer_pulse(attotime::from_hz(240/32), FUNC(keyboard_callback));
639   
641640   beep_set_frequency(machine->device("beeper"),300); //guesswork
642641   beep_set_state(machine->device("beeper"),0);
643642}
r10318r10319
760759
761760   MCFG_SOUND_ADD("beeper", BEEP, 0)
762761   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
762   
763   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32))
763764MACHINE_CONFIG_END
764765
765766/* ROM definition */
src/mess/drivers/scorpion.c
r10318r10319
262262   return address;
263263}
264264
265static TIMER_CALLBACK(nmi_check_callback)
265static TIMER_DEVICE_CALLBACK(nmi_check_callback)
266266{
267   spectrum_state *state = machine->driver_data<spectrum_state>();
267   spectrum_state *state = timer.machine->driver_data<spectrum_state>();
268268
269   if ((input_port_read(machine, "NMI") & 1)==1)
269   if ((input_port_read(timer.machine, "NMI") & 1)==1)
270270   {
271271      state->port_1ffd_data |= 0x02;
272      scorpion_update_memory(machine);
273      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
272      scorpion_update_memory(timer.machine);
273      cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
274274   }
275275}
276276
r10318r10319
345345}
346346static MACHINE_START( scorpion )
347347{
348   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(nmi_check_callback));
349348}
350349
351350
r10318r10319
416415   /* internal ram */
417416   MCFG_RAM_MODIFY(RAM_TAG)
418417   MCFG_RAM_DEFAULT_SIZE("256K")
418   
419   MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_check_callback, attotime::from_hz(50))
419420MACHINE_CONFIG_END
420421
421422static MACHINE_CONFIG_DERIVED( profi, scorpion )
src/mess/drivers/mpf1.c
r10318r10319
350350
351351/* Machine Initialization */
352352
353static TIMER_CALLBACK( check_halt_callback )
353static TIMER_DEVICE_CALLBACK( check_halt_callback )
354354{
355355   // halt-LED; the red one, is turned on when the processor is halted
356356   // TODO: processor seems to halt, but restarts(?) at 0x0000 after a while -> fix
357   INT64 led_halt = cpu_get_reg(machine->device(Z80_TAG), Z80_HALT);
358   set_led_status(machine, 1, led_halt);
357   INT64 led_halt = cpu_get_reg(timer.machine->device(Z80_TAG), Z80_HALT);
358   set_led_status(timer.machine, 1, led_halt);
359359}
360360
361361static MACHINE_START( mpf1 )
r10318r10319
372372   state_save_register_global(machine, state->_break);
373373   state_save_register_global(machine, state->m1);
374374   state_save_register_global(machine, state->lednum);
375
376   machine->scheduler().timer_pulse(attotime::from_hz(1), FUNC(check_halt_callback));
377375}
378376
379377static MACHINE_RESET( mpf1 )
r10318r10319
409407   MCFG_SPEAKER_STANDARD_MONO("mono")
410408   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
411409   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
410
411   MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
412412MACHINE_CONFIG_END
413413
414414static MACHINE_CONFIG_START( mpf1b, mpf1_state )
r10318r10319
439439   MCFG_SOUND_ADD(TMS5220_TAG, TMS5220, 680000L)
440440   MCFG_SOUND_CONFIG(mpf1_tms5220_intf)
441441   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
442   
443   MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))   
442444MACHINE_CONFIG_END
443445
444446static MACHINE_CONFIG_START( mpf1p, mpf1_state )
r10318r10319
465467   MCFG_SPEAKER_STANDARD_MONO("mono")
466468   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
467469   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
470
471   MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))   
468472MACHINE_CONFIG_END
469473
470474/* ROMs */
src/mess/drivers/mk2.c
r10318r10319
8787INPUT_PORTS_END
8888
8989
90static TIMER_CALLBACK( update_leds )
90static TIMER_DEVICE_CALLBACK( update_leds )
9191{
92   mk2_state *state = machine->driver_data<mk2_state>();
92   mk2_state *state = timer.machine->driver_data<mk2_state>();
9393   int i;
9494
9595   for (i=0; i<4; i++)
r10318r10319
104104
105105static MACHINE_START( mk2 )
106106{
107   machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(update_leds));
108107}
109108
110109static READ8_DEVICE_HANDLER( mk2_read_a )
r10318r10319
196195
197196   MCFG_SOUND_ADD("dac", DAC, 0)
198197   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
198   
199   MCFG_TIMER_ADD_PERIODIC("led_timer", update_leds, attotime::from_hz(60))
199200MACHINE_CONFIG_END
200201
201202
src/mess/drivers/pcw.c
r10318r10319
170170}
171171
172172/* callback for 1/300ths of a second interrupt */
173static TIMER_CALLBACK(pcw_timer_interrupt)
173static TIMER_DEVICE_CALLBACK(pcw_timer_interrupt)
174174{
175   pcw_state *state = machine->driver_data<pcw_state>();
175   pcw_state *state = timer.machine->driver_data<pcw_state>();
176176   pcw_update_interrupt_counter(state);
177177
178178   state->timer_irq_flag = 1;
179   pcw_update_irqs(machine);
180   machine->scheduler().timer_set(attotime::from_usec(100), FUNC(pcw_timer_pulse));
179   pcw_update_irqs(timer.machine);
180   timer.machine->scheduler().timer_set(attotime::from_usec(100), FUNC(pcw_timer_pulse));
181181}
182182
183183/* fdc interrupt callback. set/clear fdc int */
r10318r10319
11181118   state->roller_ram_offset = 0;
11191119
11201120   /* timer interrupt */
1121   machine->scheduler().timer_pulse(attotime::from_hz(300), FUNC(pcw_timer_interrupt));
1122
11231121   machine->scheduler().timer_set(attotime::zero, FUNC(setup_beep));
11241122
11251123   state->prn_stepper = machine->scheduler().timer_alloc(FUNC(pcw_stepper_callback));
r10318r10319
13751373   /* internal ram */
13761374   MCFG_RAM_ADD(RAM_TAG)
13771375   MCFG_RAM_DEFAULT_SIZE("256K")
1376   
1377   MCFG_TIMER_ADD_PERIODIC("pcw_timer", pcw_timer_interrupt, attotime::from_hz(300))   
13781378MACHINE_CONFIG_END
13791379
13801380static MACHINE_CONFIG_DERIVED( pcw8256, pcw )
src/mess/drivers/tk80bs.c
r10318r10319
242242   PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT)
243243INPUT_PORTS_END
244244
245static TIMER_CALLBACK( keyboard_callback )
245static TIMER_DEVICE_CALLBACK( keyboard_callback )
246246{
247   tk80bs_state *state = machine->driver_data<tk80bs_state>();
247   tk80bs_state *state = timer.machine->driver_data<tk80bs_state>();
248248   static const char *const portnames[3] = { "key1","key2","key3" };
249249   int i,port_i,scancode;
250   UINT8 keymod = input_port_read(machine,"key_modifiers") & 0x1f;
250   UINT8 keymod = input_port_read(timer.machine,"key_modifiers") & 0x1f;
251251   scancode = 0;
252252
253253   state->shift_press_flag = ((keymod & 0x02) >> 1);
r10318r10319
256256   {
257257      for(i=0;i<32;i++)
258258      {
259         if((input_port_read(machine,portnames[port_i])>>i) & 1)
259         if((input_port_read(timer.machine,portnames[port_i])>>i) & 1)
260260         {
261261            if(keymod & 0x04) // kana key pressed
262262            {
r10318r10319
295295
296296static MACHINE_START(tk80bs)
297297{
298   machine->scheduler().timer_pulse(attotime::from_hz(240/32), FUNC(keyboard_callback));
299298}
300299
301300static MACHINE_RESET(tk80bs)
r10318r10319
369368   
370369    MCFG_VIDEO_START(tk80)
371370    MCFG_VIDEO_UPDATE(tk80)
371   
372   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32))
372373MACHINE_CONFIG_END
373374
374375static MACHINE_CONFIG_START( tk80bs, tk80bs_state )
r10318r10319
394395
395396    MCFG_VIDEO_START(tk80bs)
396397    MCFG_VIDEO_UPDATE(tk80bs)
398
399   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32))
397400MACHINE_CONFIG_END
398401
399402/* ROM definition */
src/mess/drivers/fk1.c
r10318r10319
338338      PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
339339INPUT_PORTS_END
340340
341static TIMER_CALLBACK(keyboard_callback)
341static TIMER_DEVICE_CALLBACK(keyboard_callback)
342342{
343   fk1_state *state = machine->driver_data<fk1_state>();
343   fk1_state *state = timer.machine->driver_data<fk1_state>();
344344
345   if (input_port_read(machine, "LINE0")) {
345   if (input_port_read(timer.machine, "LINE0")) {
346346      state->int_vector = 6;
347      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
347      cputag_set_input_line(timer.machine, "maincpu", 0, HOLD_LINE);
348348   }
349349}
350350
r10318r10319
367367   return state->int_vector * 2;
368368}
369369
370static TIMER_CALLBACK( vsync_callback )
370static TIMER_DEVICE_CALLBACK( vsync_callback )
371371{
372   fk1_state *state = machine->driver_data<fk1_state>();
372   fk1_state *state = timer.machine->driver_data<fk1_state>();
373373
374374   state->int_vector = 3;
375   cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
375   cputag_set_input_line(timer.machine, "maincpu", 0, HOLD_LINE);
376376}
377377
378378
r10318r10319
390390
391391static MACHINE_START( fk1 )
392392{
393   machine->scheduler().timer_pulse(attotime::from_hz(24000), FUNC(keyboard_callback));
394   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(vsync_callback));
395393}
396394
397395static VIDEO_UPDATE( fk1 )
r10318r10319
447445   /* internal ram */
448446   MCFG_RAM_ADD(RAM_TAG)
449447   MCFG_RAM_DEFAULT_SIZE("80K") // 64 + 16
448   
449   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(24000))
450   MCFG_TIMER_ADD_PERIODIC("vsync_timer", vsync_callback, attotime::from_hz(50))
450451MACHINE_CONFIG_END
451452
452453/* ROM definition */
src/mess/drivers/multi8.c
r10318r10319
395395   PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT)
396396INPUT_PORTS_END
397397
398static TIMER_CALLBACK( keyboard_callback )
398static TIMER_DEVICE_CALLBACK( keyboard_callback )
399399{
400   multi8_state *state = machine->driver_data<multi8_state>();
400   multi8_state *state = timer.machine->driver_data<multi8_state>();
401401   static const char *const portnames[3] = { "key1","key2","key3" };
402402   int i,port_i,scancode;
403   UINT8 keymod = input_port_read(machine,"key_modifiers") & 0x1f;
403   UINT8 keymod = input_port_read(timer.machine,"key_modifiers") & 0x1f;
404404   scancode = 0;
405405
406406   state->shift_press_flag = ((keymod & 0x02) >> 1);
r10318r10319
409409   {
410410      for(i=0;i<32;i++)
411411      {
412         if((input_port_read(machine,portnames[port_i])>>i) & 1)
412         if((input_port_read(timer.machine,portnames[port_i])>>i) & 1)
413413         {
414414            //key_flag = 1;
415415            if(!state->shift_press_flag)  // shift not pressed
r10318r10319
563563
564564static MACHINE_START(multi8)
565565{
566   machine->scheduler().timer_pulse(attotime::from_hz(240/32), FUNC(keyboard_callback));
567566}
568567
569568static MACHINE_RESET(multi8)
r10318r10319
609608
610609   MCFG_SOUND_ADD("beeper", BEEP, 0)
611610   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
611   
612   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32))
612613MACHINE_CONFIG_END
613614
614615/* ROM definition */
src/mess/drivers/bml3.c
r10318r10319
409409   NULL      /* update address callback */
410410};
411411
412static TIMER_CALLBACK( keyboard_callback )
412static TIMER_DEVICE_CALLBACK( keyboard_callback )
413413{
414   bml3_state *state = machine->driver_data<bml3_state>();
414   bml3_state *state = timer.machine->driver_data<bml3_state>();
415415   static const char *const portnames[3] = { "key1","key2","key3" };
416416   int i,port_i,scancode;
417417   scancode = 0;
r10318r10319
420420   {
421421      for(i=0;i<32;i++)
422422      {
423         if((input_port_read(machine,portnames[port_i])>>i) & 1)
423         if((input_port_read(timer.machine,portnames[port_i])>>i) & 1)
424424         {
425425            {
426426               state->keyb_press = scancode;
427427               state->keyb_press_flag = 1;
428               cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
428               cputag_set_input_line(timer.machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
429429               return;
430430            }
431431         }
r10318r10319
458458
459459static MACHINE_START(bml3)
460460{
461   machine->scheduler().timer_pulse(attotime::from_hz(240/8), FUNC(keyboard_callback));
462461   beep_set_frequency(machine->device("beeper"),1200); //guesswork
463462   beep_set_state(machine->device("beeper"),0);
464463}
r10318r10319
515514
516515   MCFG_SOUND_ADD("beeper", BEEP, 0)
517516   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
517   
518   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/8))
518519MACHINE_CONFIG_END
519520
520521/* ROM definition */
src/mess/drivers/junior.c
r10318r10319
169169};
170170
171171
172static TIMER_CALLBACK( junior_update_leds )
172static TIMER_DEVICE_CALLBACK( junior_update_leds )
173173{
174   junior_state *state = machine->driver_data<junior_state>();
174   junior_state *state = timer.machine->driver_data<junior_state>();
175175   int i;
176176
177177   for ( i = 0; i < 6; i++ )
r10318r10319
188188{
189189   junior_state *state = machine->driver_data<junior_state>();
190190   state_save_register_item(machine, "junior", NULL, 0, state->port_a );
191   state_save_register_item(machine, "junior", NULL, 0, state->port_b );
192   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(junior_update_leds));
191   state_save_register_item(machine, "junior", NULL, 0, state->port_b );   
193192}
194193
195194
r10318r10319
218217    MCFG_DEFAULT_LAYOUT( layout_junior )
219218
220219    MCFG_RIOT6532_ADD("riot", XTAL_1MHz, junior_riot_interface)
220   
221   MCFG_TIMER_ADD_PERIODIC("led_timer", junior_update_leds, attotime::from_hz(50))
221222MACHINE_CONFIG_END
222223
223224
src/mess/drivers/nanos.c
r10318r10319
328328   return 0;
329329}
330330
331static TIMER_CALLBACK(keyboard_callback)
331static TIMER_DEVICE_CALLBACK(keyboard_callback)
332332{
333   nanos_state *state = machine->driver_data<nanos_state>();
333   nanos_state *state = timer.machine->driver_data<nanos_state>();
334334   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6" };
335335
336336   int i;
337337   UINT8 code;
338338   UINT8 key_code = 0;
339   UINT8 shift = input_port_read(machine, "LINEC") & 0x02 ? 1 : 0;
340   UINT8 ctrl =  input_port_read(machine, "LINEC") & 0x01 ? 1 : 0;
339   UINT8 shift = input_port_read(timer.machine, "LINEC") & 0x02 ? 1 : 0;
340   UINT8 ctrl =  input_port_read(timer.machine, "LINEC") & 0x01 ? 1 : 0;
341341   state->key_pressed = 0xff;
342342   for(i = 0; i < 7; i++)
343343   {
344344
345      code =   input_port_read(machine, keynames[i]);
345      code =   input_port_read(timer.machine, keynames[i]);
346346      if (code != 0)
347347      {
348348         if (i==0 && shift==0) {
r10318r10319
416416{
417417   nanos_state *state = machine->driver_data<nanos_state>();
418418   state->key_pressed = 0xff;
419   machine->scheduler().timer_pulse(attotime::from_hz(24000), FUNC(keyboard_callback));
420419}
421420
422421static MACHINE_RESET(nanos)
r10318r10319
534533   /* internal ram */
535534   MCFG_RAM_ADD(RAM_TAG)
536535   MCFG_RAM_DEFAULT_SIZE("64K")
536   
537   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(24000))
537538MACHINE_CONFIG_END
538539
539540/* ROM definition */
src/mess/drivers/nc.c
r10318r10319
492492
493493
494494
495static TIMER_CALLBACK(dummy_timer_callback)
495static TIMER_DEVICE_CALLBACK(dummy_timer_callback)
496496{
497   nc_state *state = machine->driver_data<nc_state>();
497   nc_state *state = timer.machine->driver_data<nc_state>();
498498   int inputport_10_state;
499499   int changed_bits;
500500
501   inputport_10_state = input_port_read(machine, "EXTRA");
501   inputport_10_state = input_port_read(timer.machine, "EXTRA");
502502
503503   changed_bits = inputport_10_state^state->previous_inputport_10_state;
504504
r10318r10319
514514            case NC_TYPE_1xx:
515515            {
516516                 LOG(("nmi triggered\n"));
517                cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
517                cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
518518            }
519519            break;
520520
521521            case NC_TYPE_200:
522522            {
523523               state->irq_status |= (1 << 4);
524               nc_update_interrupts(machine);
524               nc_update_interrupts(timer.machine);
525525            }
526526            break;
527527         }
r10318r10319
532532   if (changed_bits & 0x02)
533533   {
534534      /* yes refresh memory config */
535      nc_refresh_memory_config(machine);
535      nc_refresh_memory_config(timer.machine);
536536   }
537537
538538   state->previous_inputport_10_state = inputport_10_state;
r10318r10319
996996   state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(nc_keyboard_timer_callback));
997997   timer_adjust_oneshot(state->keyboard_timer, attotime::from_msec(10), 0);
998998
999   /* dummy timer */
1000   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(dummy_timer_callback));
1001
1002999   /* serial timer */
10031000   state->serial_timer = machine->scheduler().timer_alloc(FUNC(nc_serial_timer_callback));
10041001}
r10318r10319
13951392   state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(nc_keyboard_timer_callback));
13961393   timer_adjust_oneshot(state->keyboard_timer, attotime::from_msec(10), 0);
13971394
1398   /* dummy timer */
1399   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(dummy_timer_callback));
1400
14011395   /* serial timer */
14021396   state->serial_timer = machine->scheduler().timer_alloc(FUNC(nc_serial_timer_callback));
14031397}
r10318r10319
17451739   MCFG_RAM_DEFAULT_SIZE("64K")
17461740
17471741   MCFG_NC_SERIAL_ADD("serial")
1742   
1743   /* dummy timer */
1744   MCFG_TIMER_ADD_PERIODIC("dummy_timer", dummy_timer_callback, attotime::from_hz(50))   
17481745MACHINE_CONFIG_END
17491746
17501747static const floppy_config nc200_floppy_config =
r10318r10319
17931790   /* internal ram */
17941791   MCFG_RAM_MODIFY(RAM_TAG)
17951792   MCFG_RAM_DEFAULT_SIZE("128K")
1793
1794   /* dummy timer */
1795   MCFG_TIMER_ADD_PERIODIC("dummy_timer", dummy_timer_callback, attotime::from_hz(50))   
17961796MACHINE_CONFIG_END
17971797
17981798
src/mess/drivers/z88.c
r10318r10319
7979
8080
8181
82static TIMER_CALLBACK(z88_rtc_timer_callback)
82static TIMER_DEVICE_CALLBACK(z88_rtc_timer_callback)
8383{
84   z88_state *state = machine->driver_data<z88_state>();
84   z88_state *state = timer.machine->driver_data<z88_state>();
8585   int refresh_ints = 0;
8686   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
8787
r10318r10319
9494      /* any key pressed will wake up z88 */
9595      for (i=0; i<8; i++)
9696      {
97         data &= input_port_read(machine, keynames[i]);
97         data &= input_port_read(timer.machine, keynames[i]);
9898      }
9999
100100      /* if any key is pressed, then one or more bits will be 0 */
r10318r10319
107107         /* column has gone low in snooze/coma */
108108         state->blink.sta |= STA_KEY;
109109
110         cpuexec_trigger(machine, Z88_SNOOZE_TRIGGER);
110         cpuexec_trigger(timer.machine, Z88_SNOOZE_TRIGGER);
111111
112         z88_interrupt_refresh(machine);
112         z88_interrupt_refresh(timer.machine);
113113      }
114114   }
115115
r10318r10319
173173
174174   if (refresh_ints)
175175   {
176      z88_update_rtc_interrupt(machine);
176      z88_update_rtc_interrupt(timer.machine);
177177
178178      /* refresh */
179      z88_interrupt_refresh(machine);
179      z88_interrupt_refresh(timer.machine);
180180   }
181181}
182182
r10318r10319
299299
300300static MACHINE_START( z88 )
301301{
302   machine->scheduler().timer_pulse(attotime::from_msec(5), FUNC(z88_rtc_timer_callback));
303302}
304303
305304static MACHINE_RESET( z88 )
r10318r10319
775774   /* internal ram */
776775   MCFG_RAM_ADD(RAM_TAG)
777776   MCFG_RAM_DEFAULT_SIZE("2M")
777   
778   MCFG_TIMER_ADD_PERIODIC("rtc_timer", z88_rtc_timer_callback, attotime::from_msec(5))
778779MACHINE_CONFIG_END
779780
780781
src/mess/drivers/pcw16.c
r10318r10319
136136}
137137
138138
139static TIMER_CALLBACK(pcw16_timer_callback)
139static TIMER_DEVICE_CALLBACK(pcw16_timer_callback)
140140{
141   pcw16_state *state = machine->driver_data<pcw16_state>();
141   pcw16_state *state = timer.machine->driver_data<pcw16_state>();
142142   /* do not increment past 15 */
143143   if (state->interrupt_counter!=15)
144144   {
r10318r10319
149149
150150   if (state->interrupt_counter!=0)
151151   {
152      pcw16_refresh_ints(machine);
152      pcw16_refresh_ints(timer.machine);
153153   }
154154}
155155
r10318r10319
781781}
782782
783783
784static TIMER_CALLBACK(pcw16_keyboard_timer_callback)
784static TIMER_DEVICE_CALLBACK(pcw16_keyboard_timer_callback)
785785{
786   pcw16_state *state = machine->driver_data<pcw16_state>();
786   pcw16_state *state = timer.machine->driver_data<pcw16_state>();
787787   at_keyboard_polling();
788788   if (pcw16_keyboard_can_transmit(state))
789789   {
r10318r10319
798798//              pcw16_dump_cpu_ram();
799799//          }
800800
801         pcw16_keyboard_signal_byte_received(machine, data);
801         pcw16_keyboard_signal_byte_received(timer.machine, data);
802802      }
803803   }
804804}
r10318r10319
839839   }
840840}
841841
842static TIMER_CALLBACK(rtc_timer_callback)
842static TIMER_DEVICE_CALLBACK(rtc_timer_callback)
843843{
844   pcw16_state *state = machine->driver_data<pcw16_state>();
844   pcw16_state *state = timer.machine->driver_data<pcw16_state>();
845845   int fraction_of_second;
846846
847847   /* halt counter? */
r10318r10319
13601360   state->system_status = 0;
13611361   state->interrupt_counter = 0;
13621362
1363   /* video ints */
1364   machine->scheduler().timer_pulse(attotime::from_usec(5830), FUNC(pcw16_timer_callback));
1365   /* rtc timer */
1366   machine->scheduler().timer_pulse(attotime::from_hz(256), FUNC(rtc_timer_callback));
1367   /* keyboard timer */
1368   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(pcw16_keyboard_timer_callback));
1369
1370
13711363   pc_fdc_init(machine, &pcw16_fdc_interface);
13721364
13731365   /* initialise mouse */
r10318r10319
14571449   MCFG_RAM_DEFAULT_SIZE("2M")
14581450   MCFG_INTEL_E28F008SA_ADD("flash0")
14591451   MCFG_INTEL_E28F008SA_ADD("flash1")
1452   
1453   /* video ints */
1454   MCFG_TIMER_ADD_PERIODIC("video_timer", pcw16_timer_callback, attotime::from_hz(5830))
1455   /* rtc timer */
1456   MCFG_TIMER_ADD_PERIODIC("rtc_timer", rtc_timer_callback, attotime::from_hz(256))
1457   /* keyboard timer */
1458   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", pcw16_keyboard_timer_callback, attotime::from_hz(50))
14601459MACHINE_CONFIG_END
14611460
14621461/***************************************************************************
src/mess/drivers/vt100.c
r10318r10319
9292   return 0;
9393}
9494
95static TIMER_CALLBACK(keyboard_callback)
95static TIMER_DEVICE_CALLBACK(keyboard_callback)
9696{
97   vt100_state *state = machine->driver_data<vt100_state>();
97   vt100_state *state = timer.machine->driver_data<vt100_state>();
9898   int i;
9999   static const char *const keynames[] = {
100100      "LINE0", "LINE1", "LINE2", "LINE3",
r10318r10319
106106   if (state->key_scan) {
107107      for(i = 0; i < 16; i++)
108108      {
109         code =   input_port_read(machine, keynames[i]);
109         code =   input_port_read(timer.machine, keynames[i]);
110110         if (code!=0xff) {
111111            state->keyboard_int = 1;
112112            state->key_code = i | bit_sel(code);
113            cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
113            cputag_set_input_line(timer.machine, "maincpu", 0, HOLD_LINE);
114114            break;
115115         }
116116      }
r10318r10319
323323
324324static MACHINE_START(vt100)
325325{
326   machine->scheduler().timer_pulse(attotime::from_hz(800), FUNC(keyboard_callback));
327326}
328327
329328static MACHINE_RESET(vt100)
r10318r10319
423422   MCFG_SPEAKER_STANDARD_MONO("mono")
424423   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
425424   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
425   
426   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(800))
426427MACHINE_CONFIG_END
427428
428429static MACHINE_CONFIG_DERIVED( vt180, vt100 )
src/mess/drivers/pasogo.c
r10318r10319
6565};
6666
6767
68static TIMER_CALLBACK( vg230_timer )
68static TIMER_DEVICE_CALLBACK( vg230_timer )
6969{
70   pasogo_state *state = machine->driver_data<pasogo_state>();
70   pasogo_state *state = timer.machine->driver_data<pasogo_state>();
7171   vg230_t *vg230 = &state->vg230;
7272
7373   vg230->rtc.seconds+=1;
r10318r10319
104104
105105   memset(vg230, 0, sizeof(*vg230));
106106   vg230->pmu.write_protected=TRUE;
107   machine->scheduler().timer_pulse(attotime::from_hz(1), FUNC(vg230_timer));
108
109
110107   machine->base_datetime(systime);
111108
112109   vg230->rtc.seconds= systime.local_time.second;
r10318r10319
536533   MCFG_CARTSLOT_MANDATORY
537534   MCFG_CARTSLOT_INTERFACE("pasogo_cart")
538535   MCFG_SOFTWARE_LIST_ADD("cart_list","pasogo")
536
537   MCFG_TIMER_ADD_PERIODIC("vg230_timer", vg230_timer, attotime::from_hz(1))
539538MACHINE_CONFIG_END
540539
541540
src/mess/drivers/pc8801.c
r10318r10319
19201920   }
19211921}
19221922
1923static TIMER_CALLBACK( pc8801_rtc_irq )
1923static TIMER_DEVICE_CALLBACK( pc8801_rtc_irq )
19241924{
19251925   if(timer_irq_mask)
19261926   {
19271927      timer_irq_latch = 1;
1928      cputag_set_input_line(machine,"maincpu",0,HOLD_LINE);
1928      cputag_set_input_line(timer.machine,"maincpu",0,HOLD_LINE);
19291929   }
19301930}
19311931
r10318r10319
19421942static MACHINE_START( pc8801 )
19431943{
19441944   cpu_set_irq_callback(machine->device("maincpu"), pc8801_irq_callback);
1945
1946   machine->scheduler().timer_pulse(attotime::from_hz(600), FUNC(pc8801_rtc_irq));
19471945}
19481946
19491947static MACHINE_RESET( pc8801 )
r10318r10319
21432141
21442142   MCFG_SOUND_ADD("beeper", BEEP, 0)
21452143   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
2144
2145   MCFG_TIMER_ADD_PERIODIC("rtc_timer", pc8801_rtc_irq, attotime::from_hz(600))
21462146MACHINE_CONFIG_END
21472147
21482148static MACHINE_CONFIG_DERIVED( pc8801fh, pc8801 )
src/mess/drivers/coleco.c
r10318r10319
220220   drvstate->last_state = state;
221221}
222222
223static TIMER_CALLBACK( paddle_callback )
223static TIMER_DEVICE_CALLBACK( paddle_callback )
224224{
225   coleco_state *state = machine->driver_data<coleco_state>();
225   coleco_state *state = timer.machine->driver_data<coleco_state>();
226226
227   coleco_scan_paddles(machine, &state->joy_status[0], &state->joy_status[1]);
227   coleco_scan_paddles(timer.machine, &state->joy_status[0], &state->joy_status[1]);
228228
229229    if (state->joy_status[0] || state->joy_status[1])
230      cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, HOLD_LINE);
230      cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_IRQ0, HOLD_LINE);
231231}
232232
233233/* Machine Initialization */
r10318r10319
243243static MACHINE_START( coleco )
244244{
245245   TMS9928A_configure(&tms9928a_interface);
246   machine->scheduler().timer_pulse(attotime::from_msec(20), FUNC(paddle_callback));
247246}
248247
249248static MACHINE_RESET( coleco )
r10318r10319
317316
318317   /* software lists */
319318   MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
319   
320   MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_callback, attotime::from_msec(20))
320321MACHINE_CONFIG_END
321322
322323static MACHINE_CONFIG_START( czz50, coleco_state )
r10318r10319
349350
350351   /* software lists */
351352   MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
353   
354   MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_callback, attotime::from_msec(20))
352355MACHINE_CONFIG_END
353356
354357static MACHINE_CONFIG_DERIVED( dina, czz50 )
src/mess/drivers/4004clk.c
r10318r10319
124124
125125*/
126126
127static TIMER_CALLBACK(timer_callback)
127static TIMER_DEVICE_CALLBACK(timer_callback)
128128{
129   _4004clk_state *state = machine->driver_data<_4004clk_state>();
130   i4004_set_test(machine->device("maincpu"),state->timer);
129   _4004clk_state *state = timer.machine->driver_data<_4004clk_state>();
130   i4004_set_test(timer.machine->device("maincpu"),state->timer);
131131   state->timer^=1;
132132}
133133
r10318r10319
137137   state->timer = 0;
138138   state->dac = machine->device("dac");
139139
140   machine->scheduler().timer_pulse(attotime::from_hz(120), FUNC(timer_callback));
141
142140   /* register for state saving */
143141   state_save_register_global(machine, state->timer);
144142   state_save_register_global_pointer(machine, state->nixie, 6);
r10318r10319
161159   MCFG_SPEAKER_STANDARD_MONO("mono")
162160   MCFG_SOUND_ADD("dac", DAC, 0)
163161   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
162   
163   MCFG_TIMER_ADD_PERIODIC("4004clk_timer", timer_callback, attotime::from_hz(120))
164164MACHINE_CONFIG_END
165165
166166/* ROM definition */
src/mess/drivers/vg5k.c
r10318r10319
280280}
281281
282282
283static TIMER_CALLBACK( z80_irq )
283static TIMER_DEVICE_CALLBACK( z80_irq )
284284{
285   cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
285   cputag_set_input_line(timer.machine, "maincpu", 0, ASSERT_LINE);
286286
287   machine->scheduler().timer_set(attotime::from_usec(100), FUNC(z80_irq_clear));
287   timer.machine->scheduler().timer_set(attotime::from_usec(100), FUNC(z80_irq_clear));
288288}
289289
290290static TIMER_DEVICE_CALLBACK( vg5k_scanline )
r10318r10319
304304   vg5k->printer = machine->device("printer");
305305   vg5k->cassette = machine->device("cassette");
306306
307   machine->scheduler().timer_pulse(attotime::from_msec(20), FUNC(z80_irq));
308
309307   state_save_register_global(machine, vg5k->ef9345_offset);
310308}
311309
r10318r10319
440438
441439   /* Software lists */
442440   MCFG_SOFTWARE_LIST_ADD("cass_list", "vg5k")
441   
442   MCFG_TIMER_ADD_PERIODIC("irq_timer", z80_irq, attotime::from_msec(20))
443443MACHINE_CONFIG_END
444444
445445/* ROM definition */
src/mess/drivers/mephisto.c
r10318r10319
316316INPUT_PORTS_END
317317
318318
319static TIMER_CALLBACK( update_nmi )
319static TIMER_DEVICE_CALLBACK( update_nmi )
320320{
321   mephisto_state *state = machine->driver_data<mephisto_state>();
322   device_t *speaker = machine->device("beep");
323   cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE);
321   mephisto_state *state = timer.machine->driver_data<mephisto_state>();
322   device_t *speaker = timer.machine->device("beep");
323   cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE);
324324   // dac_data_w(0,state->led_status&64?128:0);
325325   beep_set_state(speaker,state->led_status&64?1:0);
326326}
327327
328static TIMER_CALLBACK( update_irq )      //only mm2
328static TIMER_DEVICE_CALLBACK( update_irq )      //only mm2
329329{
330   mephisto_state *state = machine->driver_data<mephisto_state>();
331   device_t *speaker = machine->device("beep");
330   mephisto_state *state = timer.machine->driver_data<mephisto_state>();
331   device_t *speaker = timer.machine->device("beep");
332332
333   cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, ASSERT_LINE);
334   cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
333   cputag_set_input_line(timer.machine, "maincpu", M6502_IRQ_LINE, ASSERT_LINE);
334   cputag_set_input_line(timer.machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
335335
336336   beep_set_state(speaker,state->led_status&64?1:0);
337337}
r10318r10319
340340   mephisto_state *state = machine->driver_data<mephisto_state>();
341341   state->lcd_shift_counter=3;
342342
343   machine->scheduler().timer_pulse(attotime::from_hz(600), FUNC(update_nmi));
344   machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork));
345
346343   mboard_savestate_register(machine);
347344}
348345
r10318r10319
352349   state->lcd_shift_counter=3;
353350   state->led7=0xff;
354351
355   machine->scheduler().timer_pulse(attotime::from_hz(450), FUNC(update_irq));
356   machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork));
357
358352   mboard_savestate_register(machine);
359353}
360354
r10318r10319
397391   MCFG_SPEAKER_STANDARD_MONO("mono")
398392   MCFG_SOUND_ADD("beep", BEEP, 0)
399393   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
394   
395   MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(600))
396   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))   
400397MACHINE_CONFIG_END
401398
402399static MACHINE_CONFIG_DERIVED( rebel5, mephisto )
r10318r10319
412409   MCFG_CPU_REPLACE("maincpu", M65C02, 3700000)
413410   MCFG_CPU_PROGRAM_MAP(mm2_mem)
414411   MCFG_MACHINE_START( mm2 )
412   
413   MCFG_DEVICE_REMOVE("nmi_timer")
414   MCFG_TIMER_ADD_PERIODIC("irq_timer", update_irq, attotime::from_hz(450))
415415MACHINE_CONFIG_END
416416
417417
src/mess/drivers/supercon.c
r10318r10319
513513
514514}
515515
516static TIMER_CALLBACK( update_artwork )
516static TIMER_DEVICE_CALLBACK( update_artwork )
517517{
518   mouse_update(machine);
518   mouse_update(timer.machine);
519519}
520520
521521static TIMER_CALLBACK( update_irq )
r10318r10319
553553   state->timer_update_irq = machine->scheduler().timer_alloc(FUNC(update_irq));
554554   timer_adjust_periodic( state->timer_update_irq, attotime::zero, 0, attotime::from_hz(1000) );
555555
556   machine->scheduler().timer_pulse(attotime::from_hz(20), FUNC(update_artwork));
557
558556   state_save_register_global_array(machine,state->save_board);
559557   state_save_register_postload(machine,m_board_postload,NULL);
560558   state_save_register_presave(machine,m_board_presave,NULL);
r10318r10319
765763   MCFG_SOUND_ADD("beep", BEEP, 0)
766764   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
767765
768
766   MCFG_TIMER_ADD_PERIODIC("artwork_timer", update_artwork, attotime::from_hz(20))
769767MACHINE_CONFIG_END
770768
771769/* ROM definition */
src/mess/drivers/avigo.c
r10318r10319
160160/* this is not a real interrupt. This timer updates the stylus position from mouse
161161movements, and checks if the mouse button is pressed to emulate a press of the stylus to the screen.
162162*/
163static TIMER_CALLBACK(avigo_dummy_timer_callback)
163static TIMER_DEVICE_CALLBACK(avigo_dummy_timer_callback)
164164{
165   avigo_state *state = machine->driver_data<avigo_state>();
165   avigo_state *state = timer.machine->driver_data<avigo_state>();
166166   int i;
167167   int current_input_port_data[4];
168168   int changed;
r10318r10319
172172
173173   for (i = 0; i < 4; i++)
174174   {
175      current_input_port_data[i] = input_port_read(machine, linenames[i]);
175      current_input_port_data[i] = input_port_read(timer.machine, linenames[i]);
176176   }
177177
178178   changed = current_input_port_data[3]^state->previous_input_port_data[3];
r10318r10319
201201      if ((current_input_port_data[3] & 0x02)!=0)
202202      {
203203         /* ????? causes a NMI */
204         cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
204         cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
205205      }
206206   }
207207
r10318r10319
210210      state->previous_input_port_data[i] = current_input_port_data[i];
211211   }
212212
213   nx = input_port_read(machine, "POSX");
213   nx = input_port_read(timer.machine, "POSX");
214214   if (nx>=0x800) nx-=0x1000;
215215   else if (nx<=-0x800) nx+=0x1000;
216216
217217   dx = nx - state->ox;
218218   state->ox = nx;
219219
220   ny = input_port_read(machine, "POSY");
220   ny = input_port_read(timer.machine, "POSY");
221221   if (ny>=0x800) ny-=0x1000;
222222   else if (ny<=-0x800) ny+=0x1000;
223223
r10318r10319
227227   state->stylus_marker_x +=dx;
228228   state->stylus_marker_y +=dy;
229229
230   avigo_vh_set_stylus_marker_position(machine, state->stylus_marker_x, state->stylus_marker_y);
230   avigo_vh_set_stylus_marker_position(timer.machine, state->stylus_marker_x, state->stylus_marker_y);
231231#if 0
232232   /* not sure if keyboard generates an interrupt, or if something
233233    is plugged in for synchronisation! */
r10318r10319
256256   memcpy(state->previous_input_port_data, current_input_port_data, sizeof(int)*4);
257257
258258   /* refresh status of interrupts */
259   avigo_refresh_ints(machine);
259   avigo_refresh_ints(timer.machine);
260260}
261261
262262/* does not do anything yet */
r10318r10319
432432
433433static MACHINE_START( avigo )
434434{
435   /* a timer used to check status of pen */
436   /* an interrupt is generated when the pen is pressed to the screen */
437   machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(avigo_dummy_timer_callback));
438435}
439436
440
441437static ADDRESS_MAP_START( avigo_mem , ADDRESS_SPACE_PROGRAM, 8)
442438   AM_RANGE(0x0000, 0x3fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank5")
443439   AM_RANGE(0x4000, 0x7fff) AM_READ_BANK("bank2") AM_WRITE_BANK("bank6")
r10318r10319
985981   /* internal ram */
986982   MCFG_RAM_ADD(RAM_TAG)
987983   MCFG_RAM_DEFAULT_SIZE("128K")
984   
985   /* a timer used to check status of pen */
986   /* an interrupt is generated when the pen is pressed to the screen */
987   MCFG_TIMER_ADD_PERIODIC("avigo_timer", avigo_dummy_timer_callback, attotime::from_hz(50))   
988988MACHINE_CONFIG_END
989989
990990
src/mess/drivers/svision.c
r10318r10319
2424#define YPOS state->reg[3]
2525#define BANK state->reg[0x26]
2626
27
2827static TIMER_CALLBACK(svision_pet_timer)
2928{
3029   svision_state *state = machine->driver_data<svision_state>();
r10318r10319
5251   }
5352}
5453
54static TIMER_DEVICE_CALLBACK(svision_pet_timer_dev)
55{
56   svision_pet_timer(timer.machine,ptr,param);
57}
58
5559void svision_irq(running_machine *machine)
5660{
5761   svision_state *state = machine->driver_data<svision_state>();
r10318r10319
442446   state->svision.timer1 = machine->scheduler().timer_alloc(FUNC(svision_timer));
443447   state->pet.on = TRUE;
444448   state->pet.timer = machine->scheduler().timer_alloc(FUNC(svision_pet_timer));
445   machine->scheduler().timer_pulse(attotime::from_seconds(8) * 256/cputag_get_clock(machine, "maincpu"),FUNC(svision_pet_timer),0);
446449}
447450
448451static DEVICE_IMAGE_LOAD( svision_cart )
r10318r10319
551554   MCFG_SOFTWARE_LIST_ADD("cart_list","svision")
552555MACHINE_CONFIG_END
553556
557static MACHINE_CONFIG_DERIVED( svisions, svision )
558   MCFG_TIMER_ADD_PERIODIC("pet_timer", svision_pet_timer_dev, attotime::from_seconds(8) * 256/4000000)
559MACHINE_CONFIG_END
560
554561static MACHINE_CONFIG_DERIVED( svisionp, svision )
555562   MCFG_CPU_MODIFY("maincpu")
556563   MCFG_CPU_CLOCK(4430000)
r10318r10319
599606// marketed under a ton of firms and names
600607CONS(1992,   svision,   0,   0,   svision,   svision,   svision,   "Watara",   "Super Vision", 0)
601608// svdual 2 connected via communication port
602CONS( 1992, svisions,      svision,          0,svision,  svisions,    svisions,   "Watara", "Super Vision (PeT Communication Simulation)", 0 )
609CONS( 1992, svisions,      svision,          0,svisions,  svisions,    svisions,   "Watara", "Super Vision (PeT Communication Simulation)", 0 )
603610
604611CONS( 1993, svisionp,      svision,          0,svisionp,  svision,    svision,   "Watara", "Super Vision (PAL TV Link Colored)", 0 )
605612CONS( 1993, svisionn,      svision,          0,svisionn,  svision,    svision,   "Watara", "Super Vision (NTSC TV Link Colored)", 0 )
src/mess/drivers/ti89.c
r10318r10319
153153}
154154
155155
156static TIMER_CALLBACK( ti68k_timer_callback )
156static TIMER_DEVICE_CALLBACK( ti68k_timer_callback )
157157{
158   ti68k_state *state = machine->driver_data<ti68k_state>();
158   ti68k_state *state = timer.machine->driver_data<ti68k_state>();
159159
160160   state->timer++;
161161
r10318r10319
182182      }
183183   }
184184
185   if (state->keypad_r(machine) != 0xff)
185   if (state->keypad_r(timer.machine) != 0xff)
186186      state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
187187}
188188
r10318r10319
461461      }
462462   }
463463
464   machine->scheduler().timer_pulse(attotime::from_hz(1<<14), FUNC(ti68k_timer_callback));
465
466464   logerror("HW=v%x, PC=%06x, Type=%s\n", m_hw_version, m_initial_pc, (m_flash_mem) ? "Flash" : "ROM");
467465}
468466
r10318r10319
532530   MCFG_DEFAULT_LAYOUT(layout_lcd)
533531
534532   MCFG_SHARP_UNK128MBIT_ADD("flash")   //should be LH28F320 for ti89t and v200 and LH28F160S3T for other models
533   
534   MCFG_TIMER_ADD_PERIODIC("ti68k_timer", ti68k_timer_callback, attotime::from_hz(1<<14))
535535MACHINE_CONFIG_END
536536
537537
src/mess/drivers/busicom.c
r10318r10319
182182INPUT_PORTS_END
183183
184184
185static TIMER_CALLBACK(timer_callback)
185static TIMER_DEVICE_CALLBACK(timer_callback)
186186{
187   busicom_state *state = machine->driver_data<busicom_state>();
187   busicom_state *state = timer.machine->driver_data<busicom_state>();
188188   state->timer ^=1;
189189   if (state->timer==1) state->drum_index++;
190190   if (state->drum_index==13) state->drum_index=0;
191   i4004_set_test(machine->device("maincpu"),state->timer);
191   i4004_set_test(timer.machine->device("maincpu"),state->timer);
192192
193193}
194194
195195static MACHINE_START(busicom)
196196{
197   machine->scheduler().timer_pulse(attotime::from_msec(28*2), FUNC(timer_callback));
198197}
199198
200199static MACHINE_RESET(busicom)
r10318r10319
238237
239238   MCFG_VIDEO_START(busicom)
240239   MCFG_VIDEO_UPDATE(busicom)
240   
241   MCFG_TIMER_ADD_PERIODIC("busicom_timer", timer_callback, attotime::from_msec(28*2))   
241242MACHINE_CONFIG_END
242243
243244/* ROM definition */
src/mess/drivers/polgar.c
r10318r10319
378378   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_1)
379379INPUT_PORTS_END
380380
381static TIMER_CALLBACK( update_nmi )
381static TIMER_DEVICE_CALLBACK( update_nmi )
382382{
383   //polgar_state *state = machine->driver_data<polgar_state>();
384   // running_device *speaker = machine->device("beep");
385   cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE);
386   // cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
383   //polgar_state *state = timer.machine->driver_data<polgar_state>();
384   // running_device *speaker = timer.machine->device("beep");
385   cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE);
386   // cputag_set_input_line(timer.machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
387387   // dac_data_w(0,state->led_status&64?128:0);
388388   // beep_set_state(speaker,state->led_status&64?1:0);
389389}
r10318r10319
391391
392392static MACHINE_START( polgar )
393393{
394   // machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(update_leds));
395   machine->scheduler().timer_pulse(attotime::from_hz(600), FUNC(update_nmi));
396   machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork));
397394   mboard_savestate_register(machine);
398395}
399396
r10318r10319
440437   MCFG_SPEAKER_STANDARD_MONO("mono")
441438   MCFG_SOUND_ADD("beep", BEEP, 0)
442439   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
440   
441   //MCFG_TIMER_ADD_PERIODIC("led_timer", update_leds, attotime::from_hz(60))
442   MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(600))
443   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
443444MACHINE_CONFIG_END
444445
445446static MACHINE_CONFIG_DERIVED( milano, polgar )
src/mess/drivers/psion.c
r10318r10319
212212
213213***********************************************/
214214
215static TIMER_CALLBACK( nmi_timer )
215static TIMER_DEVICE_CALLBACK( nmi_timer )
216216{
217   psion_state *state = machine->driver_data<psion_state>();
217   psion_state *state = timer.machine->driver_data<psion_state>();
218218
219219   if (state->m_enable_nmi)
220      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
220      cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
221221}
222222
223223UINT8 psion_state::kb_read(running_machine *machine)
r10318r10319
678678      memory_set_bank(machine, "rambank", 0);
679679   }
680680
681   machine->scheduler().timer_pulse(attotime::from_seconds(1), FUNC(nmi_timer));
682
683681   state_save_register_global(machine, m_kb_counter);
684682   state_save_register_global(machine, m_enable_nmi);
685683   state_save_register_global(machine, m_tcsr_value);
r10318r10319
796794   MCFG_NVRAM_HANDLER(psion)
797795
798796   MCFG_FRAGMENT_ADD( psion_slot )
797   
798   MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_seconds(1))
799799MACHINE_CONFIG_END
800800
801801static const UINT8 psion_4line_layout[] =
r10318r10319
840840   MCFG_NVRAM_HANDLER(psion)
841841
842842   MCFG_FRAGMENT_ADD( psion_slot )
843   
844   MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_seconds(1))
843845MACHINE_CONFIG_END
844846
845847static MACHINE_CONFIG_DERIVED( psioncm, psion_2lines )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team