src/mess/video/vtvideo.c
| r6755 | r6756 | |
| 265 | 265 | /*------------------------------------------------- |
| 266 | 266 | DEVICE_START( vt_video ) |
| 267 | 267 | -------------------------------------------------*/ |
| 268 | static TIMER_CALLBACK(lba7_change) |
| 269 | { |
| 270 | const device_config *device = ptr; |
| 271 | vt_video_t *vt = get_safe_token(device); |
| 268 | 272 | |
| 273 | vt->lba7 = (vt->lba7) ? 0 : 1; |
| 274 | } |
| 275 | |
| 269 | 276 | static DEVICE_START( vt_video ) |
| 270 | 277 | { |
| 271 | 278 | vt_video_t *vt = get_safe_token(device); |
| r6755 | r6756 | |
| 282 | 289 | vt->gfx = memory_region(device->machine, intf->char_rom_region_tag); |
| 283 | 290 | assert(vt->gfx != NULL); |
| 284 | 291 | |
| 292 | // LBA7 is scan line frequency update |
| 293 | timer_pulse(device->machine, ATTOTIME_IN_NSEC(31778), (void *) device, 0, lba7_change); |
| 285 | 294 | } |
| 286 | 295 | |
| 287 | | static TIMER_CALLBACK(lba7_change) |
| 288 | | { |
| 289 | | const device_config *device = ptr; |
| 290 | | vt_video_t *vt = get_safe_token(device); |
| 291 | 296 | |
| 292 | | vt->lba7 = (vt->lba7) ? 0 : 1; |
| 293 | | } |
| 294 | | |
| 295 | 297 | /*------------------------------------------------- |
| 296 | 298 | DEVICE_RESET( vt_video ) |
| 297 | 299 | -------------------------------------------------*/ |
| r6755 | r6756 | |
| 314 | 316 | vt->frequency = 60; |
| 315 | 317 | vt->interlaced = 1; |
| 316 | 318 | 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); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /*------------------------------------------------- |
src/mess/machine/vector06.c
| r6755 | r6756 | |
| 180 | 180 | { |
| 181 | 181 | const device_config *fdc = devtag_get_device(machine, "wd1793"); |
| 182 | 182 | wd17xx_set_density (fdc, DEN_FM_HI); |
| 183 | timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, reset_check_callback); |
| 183 | 184 | } |
| 184 | 185 | |
| 185 | 186 | MACHINE_RESET( vector06 ) |
| r6755 | r6756 | |
| 200 | 201 | vector06_keyboard_mask = 0; |
| 201 | 202 | vector06_color_index = 0; |
| 202 | 203 | vector06_video_mode = 0; |
| 203 | | timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, reset_check_callback); |
| 204 | 204 | } |
src/mess/machine/osborne1.c
| r6755 | r6756 | |
| 466 | 466 | |
| 467 | 467 | memset( messram_get_ptr(devtag_get_device(machine, "messram")) + 0x10000, 0xFF, 0x1000 ); |
| 468 | 468 | |
| 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 | | |
| 474 | 469 | for(drive=0;drive<2;drive++) |
| 475 | 470 | { |
| 476 | 471 | floppy_install_load_proc(floppy_get_device(machine, drive), osborne1_load_proc); |
| r6755 | r6756 | |
| 489 | 484 | |
| 490 | 485 | /* Configure the 6850 ACIA */ |
| 491 | 486 | // 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 ); |
| 492 | 491 | } |
| 493 | 492 | |
| 494 | 493 | |
src/mess/machine/sms.c
| r6755 | r6756 | |
| 1403 | 1403 | MACHINE_START( sms ) |
| 1404 | 1404 | { |
| 1405 | 1405 | 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); |
| 1406 | 1410 | } |
| 1407 | 1411 | |
| 1408 | 1412 | |
| r6755 | r6756 | |
| 1444 | 1448 | |
| 1445 | 1449 | sms_state.rapid_fire_state_1 = 0; |
| 1446 | 1450 | 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)); |
| 1449 | 1451 | |
| 1450 | 1452 | sms_state.last_paddle_read_time = 0; |
| 1451 | 1453 | sms_state.paddle_read_state = 0; |
| r6755 | r6756 | |
| 1466 | 1468 | sms_state.sscope_state = 0; |
| 1467 | 1469 | |
| 1468 | 1470 | 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); |
| 1472 | 1471 | } |
| 1473 | 1472 | |
| 1474 | 1473 | |
src/mess/machine/poly88.c
| r6755 | r6756 | |
| 216 | 216 | |
| 217 | 217 | serial_connection_init(machine, &poly88_cassette_serial_connection); |
| 218 | 218 | 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); |
| 219 | 221 | } |
| 220 | 222 | |
| 221 | 223 | MACHINE_RESET(poly88) |
| 222 | 224 | { |
| 223 | 225 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), poly88_irq_callback); |
| 224 | | timer_pulse(machine, ATTOTIME_IN_HZ(24000), NULL, 0, keyboard_callback); |
| 225 | 226 | intr = 0; |
| 226 | 227 | last_code = 0; |
| 227 | 228 | |
src/mess/machine/samcoupe.c
| r6755 | r6756 | |
| 226 | 226 | return result; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | MACHINE_START( samcoupe ) |
| 230 | { |
| 231 | coupe_asic *asic = machine->driver_data; |
| 232 | asic->mouse_reset = timer_alloc(machine, samcoupe_mouse_reset, 0); |
| 233 | } |
| 229 | 234 | |
| 230 | 235 | /*************************************************************************** |
| 231 | 236 | RESET |
| r6755 | r6756 | |
| 245 | 250 | asic->status = 0x1f; /* no interrupts active */ |
| 246 | 251 | |
| 247 | 252 | /* initialize mouse */ |
| 248 | | asic->mouse_reset = timer_alloc(space->machine, samcoupe_mouse_reset, 0); |
| 249 | 253 | asic->mouse_index = 0; |
| 250 | 254 | asic->mouse_data[0] = 0xff; |
| 251 | 255 | asic->mouse_data[1] = 0xff; |
src/mess/machine/z80ne.c
| r6755 | r6756 | |
| 328 | 328 | lx383_key[i] = 0xf0 | i; |
| 329 | 329 | lx383_scan_counter = 0x0f; |
| 330 | 330 | lx383_downsampler = LX383_DOWNSAMPLING; |
| 331 | | timer_pulse(machine, ATTOTIME_IN_HZ(1000), NULL, 0, z80ne_kbd_scan ); |
| 332 | 331 | |
| 333 | 332 | /* Initialize cassette interface */ |
| 334 | 333 | switch(input_port_read(machine, "LX.385") & 0x07) |
| r6755 | r6756 | |
| 437 | 436 | state_save_register_item_array( machine, "z80ne", NULL, 0, lx383_key ); |
| 438 | 437 | state_save_register_item( machine, "z80ne", NULL, 0, nmi_delay_counter ); |
| 439 | 438 | cassette_timer = timer_alloc(machine, z80ne_cassette_tc, NULL); |
| 439 | timer_pulse(machine, ATTOTIME_IN_HZ(1000), NULL, 0, z80ne_kbd_scan ); |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | MACHINE_START( z80net ) |
src/mess/machine/pc8801.c
| r6755 | r6756 | |
| 130 | 130 | interrupt_mask_reg = 0xf8; |
| 131 | 131 | interrupt_trig_reg = 0x0; |
| 132 | 132 | 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); |
| 134 | 133 | } |
| 135 | 134 | |
| 136 | 135 | WRITE8_HANDLER( pc88sr_outport_30 ) |
| r6755 | r6756 | |
| 826 | 825 | /* initialize RTC */ |
| 827 | 826 | upd1990a_cs_w(state->upd1990a, 1); |
| 828 | 827 | upd1990a_oe_w(state->upd1990a, 1); |
| 828 | |
| 829 | timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, pc8801_timer_interrupt); |
| 829 | 830 | } |
| 830 | 831 | |
| 831 | 832 | MACHINE_RESET( pc88srl ) |
src/mess/drivers/pc6001.c
| r6755 | r6756 | |
| 805 | 805 | } |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | static 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 | |
| 808 | 816 | static MACHINE_RESET(pc6001) |
| 809 | 817 | { |
| 810 | 818 | port_c_8255=0; |
| 811 | 819 | //pc6001_video_ram = pc6001_ram; |
| 812 | 820 | |
| 813 | 821 | 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); |
| 818 | 822 | cas_switch = 0; |
| 819 | 823 | cas_offset = 0; |
| 820 | 824 | } |
| r6755 | r6756 | |
| 825 | 829 | //pc6001_video_ram = pc6001_ram; |
| 826 | 830 | |
| 827 | 831 | 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); |
| 832 | 832 | cas_switch = 0; |
| 833 | 833 | cas_offset = 0; |
| 834 | 834 | |
| r6755 | r6756 | |
| 883 | 883 | MDRV_CPU_VBLANK_INT("screen", pc6001_interrupt) |
| 884 | 884 | |
| 885 | 885 | // MDRV_CPU_ADD("subcpu", I8049, 7987200) |
| 886 | | |
| 886 | MDRV_MACHINE_START(pc6001) |
| 887 | 887 | MDRV_MACHINE_RESET(pc6001) |
| 888 | 888 | |
| 889 | 889 | /* video hardware */ |
src/mess/drivers/x1.c
| r6755 | r6756 | |
| 2064 | 2064 | pcg_index[0] = pcg_index[1] = pcg_index[2] = 0; |
| 2065 | 2065 | |
| 2066 | 2066 | //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); |
| 2069 | 2067 | |
| 2070 | 2068 | cmt_current_cmd = 0; |
| 2071 | 2069 | cmt_test = 0; |
| r6755 | r6756 | |
| 2081 | 2079 | } |
| 2082 | 2080 | } |
| 2083 | 2081 | |
| 2082 | static 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 | } |
| 2084 | 2087 | static PALETTE_INIT(x1) |
| 2085 | 2088 | { |
| 2086 | 2089 | int i; |
| r6755 | r6756 | |
| 2141 | 2144 | |
| 2142 | 2145 | MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf ) |
| 2143 | 2146 | |
| 2147 | MDRV_MACHINE_START(x1) |
| 2144 | 2148 | MDRV_MACHINE_RESET(x1) |
| 2145 | 2149 | |
| 2146 | 2150 | /* video hardware */ |
src/mess/drivers/mpf1.c
| r6755 | r6756 | |
| 361 | 361 | state_save_register_global(machine, state->_break); |
| 362 | 362 | state_save_register_global(machine, state->m1); |
| 363 | 363 | state_save_register_global(machine, state->lednum); |
| 364 | |
| 365 | timer_pulse(machine, ATTOTIME_IN_HZ(1), NULL, 0, check_halt_callback); |
| 364 | 366 | } |
| 365 | 367 | |
| 366 | 368 | static MACHINE_RESET( mpf1 ) |
| r6755 | r6756 | |
| 368 | 370 | mpf1_state *state = machine->driver_data; |
| 369 | 371 | |
| 370 | 372 | state->lednum = 0; |
| 371 | | |
| 372 | | timer_pulse(machine, ATTOTIME_IN_HZ(1), NULL, 0, check_halt_callback); |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | /* Machine Drivers */ |
src/mess/drivers/nanos.c
| r6755 | r6756 | |
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | static MACHINE_START(nanos) |
| 401 | { |
| 402 | timer_pulse(machine, ATTOTIME_IN_HZ(24000), NULL, 0, keyboard_callback); |
| 403 | } |
| 404 | |
| 400 | 405 | static MACHINE_RESET(nanos) |
| 401 | 406 | { |
| 402 | 407 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| r6755 | r6756 | |
| 410 | 415 | |
| 411 | 416 | floppy_mon_w(floppy_get_device(space->machine, 0), CLEAR_LINE); |
| 412 | 417 | 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); |
| 414 | 418 | } |
| 415 | 419 | |
| 416 | 420 | static const z80pio_interface nanos_z80pio_intf = |
| r6755 | r6756 | |
| 462 | 466 | MDRV_CPU_IO_MAP(nanos_io) |
| 463 | 467 | MDRV_CPU_CONFIG(nanos_daisy_chain) |
| 464 | 468 | |
| 465 | | |
| 469 | MDRV_MACHINE_START(nanos) |
| 466 | 470 | MDRV_MACHINE_RESET(nanos) |
| 467 | 471 | |
| 468 | 472 | /* video hardware */ |
src/mess/drivers/nc.c
| r6755 | r6756 | |
| 582 | 582 | |
| 583 | 583 | nc_refresh_memory_config(machine); |
| 584 | 584 | 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 | |
| 596 | 586 | /* at reset set to 0x0ff */ |
| 597 | 587 | nc_uart_control = 0x0ff; |
| 598 | 588 | } |
| r6755 | r6756 | |
| 987 | 977 | nc_type = NC_TYPE_1xx; |
| 988 | 978 | |
| 989 | 979 | 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); |
| 990 | 990 | } |
| 991 | 991 | |
| 992 | 992 | |
src/mess/drivers/z88.c
| r6755 | r6756 | |
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | static MACHINE_START( z88 ) |
| 297 | { |
| 298 | timer_pulse(machine, ATTOTIME_IN_MSEC(5), NULL, 0, z88_rtc_timer_callback); |
| 299 | } |
| 300 | |
| 296 | 301 | static MACHINE_RESET( z88 ) |
| 297 | 302 | { |
| 298 | 303 | memset(messram_get_ptr(devtag_get_device(machine, "messram")), 0x0ff, messram_get_size(devtag_get_device(machine, "messram"))); |
| 299 | 304 | |
| 300 | | timer_pulse(machine, ATTOTIME_IN_MSEC(5), NULL, 0, z88_rtc_timer_callback); |
| 301 | | |
| 302 | 305 | blink_reset(); |
| 303 | 306 | |
| 304 | 307 | z88_refresh_memory_bank(machine, 0); |
| r6755 | r6756 | |
| 740 | 743 | MDRV_CPU_IO_MAP(z88_io) |
| 741 | 744 | MDRV_QUANTUM_TIME(HZ(60)) |
| 742 | 745 | |
| 746 | MDRV_MACHINE_START( z88 ) |
| 743 | 747 | MDRV_MACHINE_RESET( z88 ) |
| 744 | 748 | |
| 745 | 749 | /* video hardware */ |
src/mess/drivers/vt100.c
| r6755 | r6756 | |
| 275 | 275 | return retVal; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | static MACHINE_START(vt100) |
| 279 | { |
| 280 | timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback); |
| 281 | } |
| 282 | |
| 278 | 283 | static MACHINE_RESET(vt100) |
| 279 | 284 | { |
| 280 | 285 | vt100_keyboard_int = 0; |
| r6755 | r6756 | |
| 289 | 294 | output_set_value("l4_led", 1); |
| 290 | 295 | |
| 291 | 296 | vt100_key_scan = 0; |
| 292 | | timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback); |
| 293 | 297 | |
| 294 | 298 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), vt100_irq_callback); |
| 295 | 299 | } |
| r6755 | r6756 | |
| 326 | 330 | MDRV_CPU_IO_MAP(vt100_io) |
| 327 | 331 | MDRV_CPU_VBLANK_INT("screen", vt100_vertical_interrupt) |
| 328 | 332 | |
| 333 | MDRV_MACHINE_START(vt100) |
| 329 | 334 | MDRV_MACHINE_RESET(vt100) |
| 330 | 335 | |
| 331 | 336 | /* video hardware */ |