Previous 15994 Revisions Next

r6756 Friday 25th December, 2009 at 15:46:55 UTC by Miodrag Milanović
More timer error fixes
Fixed messtest compile
[src/mess/drivers]mpf1.c nanos.c nc.c pc6001.c samcoupe.c vt100.c x1.c z88.c
[src/mess/includes]samcoupe.h
[src/mess/machine]microtan.c ondra.c osborne1.c pc8801.c poly88.c samcoupe.c sms.c vector06.c z80ne.c
[src/mess/tools/messtest]testmess.c
[src/mess/video]vtvideo.c

src/mess/tools/messtest/testmess.c
r6755r6756
705705
706706static const device_config *find_device_by_identity(running_machine *machine, const messtest_device_identity *ident)
707707{
708   const device_config *device;
708   const device_config *device = NULL;
709709
710710   /* look up the image slot */
711711   if (ident->type == IO_UNKNOWN)
src/mess/video/vtvideo.c
r6755r6756
265265/*-------------------------------------------------
266266    DEVICE_START( vt_video )
267267-------------------------------------------------*/
268static TIMER_CALLBACK(lba7_change)
269{
270   const device_config *device = ptr;
271   vt_video_t *vt = get_safe_token(device);
268272
273   vt->lba7 = (vt->lba7) ? 0 : 1;
274}
275
269276static DEVICE_START( vt_video )
270277{
271278   vt_video_t *vt = get_safe_token(device);
r6755r6756
282289     vt->gfx = memory_region(device->machine, intf->char_rom_region_tag);
283290   assert(vt->gfx != NULL);
284291
292    // LBA7 is scan line frequency update
293   timer_pulse(device->machine, ATTOTIME_IN_NSEC(31778), (void *) device, 0, lba7_change);
285294}
286295
287static TIMER_CALLBACK(lba7_change)
288{
289   const device_config *device = ptr;
290   vt_video_t *vt = get_safe_token(device);
291296
292   vt->lba7 = (vt->lba7) ? 0 : 1;
293}
294
295297/*-------------------------------------------------
296298    DEVICE_RESET( vt_video )
297299-------------------------------------------------*/
r6755r6756
314316    vt->frequency = 60;
315317    vt->interlaced = 1;
316318   vt->skip_lines = 2; // for 60Hz
317    // LBA7 is scan line frequency update
318   timer_pulse(device->machine, ATTOTIME_IN_NSEC(31778), (void *) device, 0, lba7_change);
319319}
320320
321321/*-------------------------------------------------
src/mess/includes/samcoupe.h
r6755r6756
5252UINT8 samcoupe_mouse_r(running_machine *machine);
5353
5454WRITE8_HANDLER( samcoupe_ext_mem_w );
55MACHINE_START( samcoupe );
5556MACHINE_RESET( samcoupe );
5657
5758
src/mess/machine/vector06.c
r6755r6756
180180{
181181   const device_config *fdc = devtag_get_device(machine, "wd1793");
182182   wd17xx_set_density (fdc, DEN_FM_HI);
183   timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, reset_check_callback);
183184}
184185
185186MACHINE_RESET( vector06 )
r6755r6756
200201   vector06_keyboard_mask = 0;
201202   vector06_color_index = 0;
202203   vector06_video_mode = 0;
203   timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, reset_check_callback);
204204}
src/mess/machine/microtan.c
r6755r6756
921921            break;
922922    }
923923
924   microtan_timer = timer_alloc(machine, microtan_read_cassette, NULL);
924925}
925926
926927MACHINE_RESET( microtan )
r6755r6756
933934        keyrows[i] = input_port_read(machine, keynames[i-1]);
934935   }
935936    set_led_status(machine, 1, (keyrows[3] & 0x80) ? 0 : 1);
936
937   microtan_timer = timer_alloc(machine, microtan_read_cassette, NULL);
938937}
src/mess/machine/osborne1.c
r6755r6756
466466
467467   memset( messram_get_ptr(devtag_get_device(machine, "messram")) + 0x10000, 0xFF, 0x1000 );
468468
469   osborne1.video_timer = timer_alloc(machine,  osborne1_video_callback , NULL);
470   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, 0 ), 0);
471
472   timer_set(machine,  attotime_zero, NULL, 0, setup_osborne1 );
473
474469   for(drive=0;drive<2;drive++)
475470   {
476471      floppy_install_load_proc(floppy_get_device(machine, drive), osborne1_load_proc);
r6755r6756
489484
490485   /* Configure the 6850 ACIA */
491486//  acia6850_config( 0, &osborne1_6850_config );
487   osborne1.video_timer = timer_alloc(machine,  osborne1_video_callback , NULL);
488   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, 0 ), 0);
489
490   timer_set(machine,  attotime_zero, NULL, 0, setup_osborne1 );
492491}
493492
494493
src/mess/machine/sms.c
r6755r6756
14031403MACHINE_START( sms )
14041404{
14051405   add_exit_callback(machine, sms_machine_stop);
1406   sms_state.rapid_fire_timer = timer_alloc(machine, rapid_fire_callback , NULL);
1407   timer_adjust_periodic(sms_state.rapid_fire_timer, ATTOTIME_IN_HZ(10), 0, ATTOTIME_IN_HZ(10));
1408   /* Check if lightgun has been chosen as input: if so, enable crosshair */
1409   timer_set(machine, attotime_zero, NULL, 0, lightgun_tick);   
14061410}
14071411
14081412
r6755r6756
14441448
14451449   sms_state.rapid_fire_state_1 = 0;
14461450   sms_state.rapid_fire_state_2 = 0;
1447   sms_state.rapid_fire_timer = timer_alloc(machine, rapid_fire_callback , NULL);
1448   timer_adjust_periodic(sms_state.rapid_fire_timer, ATTOTIME_IN_HZ(10), 0, ATTOTIME_IN_HZ(10));
14491451
14501452   sms_state.last_paddle_read_time = 0;
14511453   sms_state.paddle_read_state = 0;
r6755r6756
14661468   sms_state.sscope_state = 0;
14671469
14681470   sms_state.tvdraw_data = 0;
1469
1470   /* Check if lightgun has been chosen as input: if so, enable crosshair */
1471   timer_set(space->machine, attotime_zero, NULL, 0, lightgun_tick);
14721471}
14731472
14741473
src/mess/machine/poly88.c
r6755r6756
216216
217217   serial_connection_init(machine, &poly88_cassette_serial_connection);
218218   serial_connection_set_in_callback(machine, &poly88_cassette_serial_connection, poly88_cassette_write);
219
220   timer_pulse(machine, ATTOTIME_IN_HZ(24000), NULL, 0, keyboard_callback);
219221}
220222
221223MACHINE_RESET(poly88)
222224{
223225   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), poly88_irq_callback);
224   timer_pulse(machine, ATTOTIME_IN_HZ(24000), NULL, 0, keyboard_callback);
225226   intr = 0;
226227   last_code = 0;
227228
src/mess/machine/samcoupe.c
r6755r6756
226226   return result;
227227}
228228
229MACHINE_START( samcoupe )
230{
231   coupe_asic *asic = machine->driver_data;
232   asic->mouse_reset = timer_alloc(machine, samcoupe_mouse_reset, 0);
233}
229234
230235/***************************************************************************
231236    RESET
r6755r6756
245250   asic->status = 0x1f;    /* no interrupts active */
246251
247252   /* initialize mouse */
248   asic->mouse_reset = timer_alloc(space->machine, samcoupe_mouse_reset, 0);
249253   asic->mouse_index = 0;
250254   asic->mouse_data[0] = 0xff;
251255   asic->mouse_data[1] = 0xff;
src/mess/machine/z80ne.c
r6755r6756
328328       lx383_key[i] = 0xf0 | i;
329329    lx383_scan_counter = 0x0f;
330330    lx383_downsampler = LX383_DOWNSAMPLING;
331    timer_pulse(machine,  ATTOTIME_IN_HZ(1000), NULL, 0, z80ne_kbd_scan );
332331
333332   /* Initialize cassette interface */
334333   switch(input_port_read(machine, "LX.385") & 0x07)
r6755r6756
437436   state_save_register_item_array( machine, "z80ne", NULL, 0, lx383_key );
438437   state_save_register_item( machine, "z80ne", NULL, 0, nmi_delay_counter );
439438   cassette_timer = timer_alloc(machine, z80ne_cassette_tc, NULL);
439    timer_pulse(machine,  ATTOTIME_IN_HZ(1000), NULL, 0, z80ne_kbd_scan );   
440440}
441441
442442MACHINE_START( z80net )
src/mess/machine/ondra.c
r6755r6756
9494   ondra_bank1_status = 0;
9595   ondra_bank2_status = 0;
9696   ondra_update_banks(machine);
97
98   timer_pulse(machine, ATTOTIME_IN_HZ(10), NULL, 0, nmi_check_callback);
9997}
10098
10199MACHINE_START(ondra)
102100{
101   timer_pulse(machine, ATTOTIME_IN_HZ(10), NULL, 0, nmi_check_callback);
103102}
src/mess/machine/pc8801.c
r6755r6756
130130   interrupt_mask_reg = 0xf8;
131131   interrupt_trig_reg = 0x0;
132132   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), pc8801_interrupt_callback);
133   timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, pc8801_timer_interrupt);
134133}
135134
136135WRITE8_HANDLER( pc88sr_outport_30 )
r6755r6756
826825   /* initialize RTC */
827826   upd1990a_cs_w(state->upd1990a, 1);
828827   upd1990a_oe_w(state->upd1990a, 1);
828   
829   timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, pc8801_timer_interrupt);
829830}
830831
831832MACHINE_RESET( pc88srl )
src/mess/drivers/pc6001.c
r6755r6756
805805   }
806806}
807807
808static MACHINE_START(pc6001)
809{
810   /* TODO: accurate timing on these (especially for the first one) */
811   timer_pulse(machine, ATTOTIME_IN_HZ(540), NULL, 0, audio_callback);
812   timer_pulse(machine, ATTOTIME_IN_HZ(250), NULL, 0, keyboard_callback);
813   timer_pulse(machine, ATTOTIME_IN_HZ(160), NULL, 0, cassette_callback);
814}
815
808816static MACHINE_RESET(pc6001)
809817{
810818   port_c_8255=0;
811819   //pc6001_video_ram =  pc6001_ram;
812820
813821   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"),pc6001_irq_callback);
814   /* TODO: accurate timing on these (especially for the first one) */
815   timer_pulse(machine, ATTOTIME_IN_HZ(540), NULL, 0, audio_callback);
816   timer_pulse(machine, ATTOTIME_IN_HZ(250), NULL, 0, keyboard_callback);
817   timer_pulse(machine, ATTOTIME_IN_HZ(160), NULL, 0, cassette_callback);
818822   cas_switch = 0;
819823   cas_offset = 0;
820824}
r6755r6756
825829   //pc6001_video_ram =  pc6001_ram;
826830
827831   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"),pc6001_irq_callback);
828   /* TODO: accurate timing on these (especially for the first one) */
829   timer_pulse(machine, ATTOTIME_IN_HZ(540), NULL, 0, audio_callback);
830   timer_pulse(machine, ATTOTIME_IN_HZ(250), NULL, 0, keyboard_callback);
831   timer_pulse(machine, ATTOTIME_IN_HZ(160), NULL, 0, cassette_callback);
832832   cas_switch = 0;
833833   cas_offset = 0;
834834
r6755r6756
883883   MDRV_CPU_VBLANK_INT("screen", pc6001_interrupt)
884884
885885//  MDRV_CPU_ADD("subcpu", I8049, 7987200)
886
886   MDRV_MACHINE_START(pc6001)
887887   MDRV_MACHINE_RESET(pc6001)
888888
889889   /* video hardware */
src/mess/drivers/x1.c
r6755r6756
20642064   pcg_index[0] = pcg_index[1] = pcg_index[2] = 0;
20652065
20662066   //cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), x1_irq_callback);
2067   timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback);
2068   timer_pulse(machine, ATTOTIME_IN_HZ(16), NULL, 0, cmt_wind_timer);
20692067
20702068   cmt_current_cmd = 0;
20712069   cmt_test = 0;
r6755r6756
20812079   }
20822080}
20832081
2082static MACHINE_START( x1 )
2083{   
2084   timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback);
2085   timer_pulse(machine, ATTOTIME_IN_HZ(16), NULL, 0, cmt_wind_timer);
2086}
20842087static PALETTE_INIT(x1)
20852088{
20862089   int i;
r6755r6756
21412144
21422145   MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf )
21432146
2147   MDRV_MACHINE_START(x1)
21442148   MDRV_MACHINE_RESET(x1)
21452149
21462150   /* video hardware */
src/mess/drivers/mpf1.c
r6755r6756
361361   state_save_register_global(machine, state->_break);
362362   state_save_register_global(machine, state->m1);
363363   state_save_register_global(machine, state->lednum);
364
365   timer_pulse(machine,  ATTOTIME_IN_HZ(1), NULL, 0, check_halt_callback);
364366}
365367
366368static MACHINE_RESET( mpf1 )
r6755r6756
368370   mpf1_state *state = machine->driver_data;
369371
370372   state->lednum = 0;
371
372   timer_pulse(machine,  ATTOTIME_IN_HZ(1), NULL, 0, check_halt_callback);
373373}
374374
375375/* Machine Drivers */
src/mess/drivers/samcoupe.c
r6755r6756
568568   MDRV_CPU_IO_MAP(samcoupe_io)
569569   MDRV_CPU_VBLANK_INT("screen", samcoupe_frame_interrupt)
570570
571   MDRV_MACHINE_START(samcoupe)
571572   MDRV_MACHINE_RESET(samcoupe)
572573   MDRV_DRIVER_DATA(coupe_asic)
573574
src/mess/drivers/nanos.c
r6755r6756
397397   }
398398}
399399
400static MACHINE_START(nanos)
401{
402   timer_pulse(machine, ATTOTIME_IN_HZ(24000), NULL, 0, keyboard_callback);
403}
404
400405static MACHINE_RESET(nanos)
401406{
402407   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
r6755r6756
410415
411416   floppy_mon_w(floppy_get_device(space->machine, 0), CLEAR_LINE);
412417   floppy_drive_set_ready_state(floppy_get_device(space->machine, 0), 1,1);
413   timer_pulse(machine, ATTOTIME_IN_HZ(24000), NULL, 0, keyboard_callback);
414418}
415419
416420static const z80pio_interface nanos_z80pio_intf =
r6755r6756
462466    MDRV_CPU_IO_MAP(nanos_io)
463467    MDRV_CPU_CONFIG(nanos_daisy_chain)
464468
465
469   MDRV_MACHINE_START(nanos)
466470    MDRV_MACHINE_RESET(nanos)
467471
468472    /* video hardware */
src/mess/drivers/nc.c
r6755r6756
582582
583583    nc_refresh_memory_config(machine);
584584   nc_update_interrupts(machine);
585
586   /* keyboard timer */
587   nc_keyboard_timer = timer_alloc(machine, nc_keyboard_timer_callback, NULL);
588   timer_adjust_oneshot(nc_keyboard_timer, ATTOTIME_IN_MSEC(10), 0);
589
590   /* dummy timer */
591   timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, dummy_timer_callback);
592
593   /* serial timer */
594   nc_serial_timer = timer_alloc(machine, nc_serial_timer_callback, NULL);
595
585   
596586   /* at reset set to 0x0ff */
597587   nc_uart_control = 0x0ff;
598588}
r6755r6756
987977    nc_type = NC_TYPE_1xx;
988978
989979   add_exit_callback(machine, nc100_machine_stop);
980
981   /* keyboard timer */
982   nc_keyboard_timer = timer_alloc(machine, nc_keyboard_timer_callback, NULL);
983   timer_adjust_oneshot(nc_keyboard_timer, ATTOTIME_IN_MSEC(10), 0);
984
985   /* dummy timer */
986   timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, dummy_timer_callback);
987
988   /* serial timer */
989   nc_serial_timer = timer_alloc(machine, nc_serial_timer_callback, NULL);   
990990}
991991
992992
src/mess/drivers/z88.c
r6755r6756
293293   }
294294}
295295
296static MACHINE_START( z88 )
297{
298   timer_pulse(machine, ATTOTIME_IN_MSEC(5), NULL, 0, z88_rtc_timer_callback);
299}
300
296301static MACHINE_RESET( z88 )
297302{
298303   memset(messram_get_ptr(devtag_get_device(machine, "messram")), 0x0ff, messram_get_size(devtag_get_device(machine, "messram")));
299304
300   timer_pulse(machine, ATTOTIME_IN_MSEC(5), NULL, 0, z88_rtc_timer_callback);
301
302305   blink_reset();
303306
304307   z88_refresh_memory_bank(machine, 0);
r6755r6756
740743   MDRV_CPU_IO_MAP(z88_io)
741744   MDRV_QUANTUM_TIME(HZ(60))
742745
746   MDRV_MACHINE_START( z88 )
743747   MDRV_MACHINE_RESET( z88 )
744748
745749   /* video hardware */
src/mess/drivers/vt100.c
r6755r6756
275275   return retVal;
276276}
277277
278static MACHINE_START(vt100)
279{
280   timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback);
281}
282
278283static MACHINE_RESET(vt100)
279284{
280285   vt100_keyboard_int = 0;
r6755r6756
289294   output_set_value("l4_led",      1);
290295
291296   vt100_key_scan = 0;
292   timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback);
293297
294298   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), vt100_irq_callback);
295299}
r6755r6756
326330   MDRV_CPU_IO_MAP(vt100_io)
327331   MDRV_CPU_VBLANK_INT("screen", vt100_vertical_interrupt)
328332
333   MDRV_MACHINE_START(vt100)
329334   MDRV_MACHINE_RESET(vt100)
330335
331336    /* video hardware */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team