src/mess/drivers/pc6001.c
| r10318 | r10319 | |
| 1961 | 1961 | return joy_press; |
| 1962 | 1962 | } |
| 1963 | 1963 | |
| 1964 | | static TIMER_CALLBACK(cassette_callback) |
| 1964 | static TIMER_DEVICE_CALLBACK(cassette_callback) |
| 1965 | 1965 | { |
| 1966 | | pc6001_state *state = machine->driver_data<pc6001_state>(); |
| 1966 | pc6001_state *state = timer.machine->driver_data<pc6001_state>(); |
| 1967 | 1967 | if(state->cas_switch == 1) |
| 1968 | 1968 | { |
| 1969 | 1969 | #if 0 |
| 1970 | 1970 | static UINT8 cas_data_i = 0x80,cas_data_poll; |
| 1971 | 1971 | //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) |
| 1973 | 1973 | cas_data_poll|= cas_data_i; |
| 1974 | 1974 | else |
| 1975 | 1975 | cas_data_poll&=~cas_data_i; |
| r10318 | r10319 | |
| 1979 | 1979 | cas_data_i = 0x80; |
| 1980 | 1980 | /* data ready, poll irq */ |
| 1981 | 1981 | 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); |
| 1983 | 1983 | } |
| 1984 | 1984 | else |
| 1985 | 1985 | cas_data_i>>=1; |
| 1986 | 1986 | #else |
| 1987 | | UINT8 *cas_data = machine->region("cas")->base(); |
| 1987 | UINT8 *cas_data = timer.machine->region("cas")->base(); |
| 1988 | 1988 | |
| 1989 | 1989 | state->cur_keycode = cas_data[state->cas_offset++]; |
| 1990 | 1990 | popmessage("%04x %04x",state->cas_offset,state->cas_maxsize); |
| r10318 | r10319 | |
| 1994 | 1994 | state->cas_switch = 0; |
| 1995 | 1995 | if(IRQ_LOG) printf("Tape-E IRQ 0x12\n"); |
| 1996 | 1996 | 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); |
| 1998 | 1998 | } |
| 1999 | 1999 | else |
| 2000 | 2000 | { |
| 2001 | 2001 | if(IRQ_LOG) printf("Tape-D IRQ 0x08\n"); |
| 2002 | 2002 | 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); |
| 2004 | 2004 | } |
| 2005 | 2005 | #endif |
| 2006 | 2006 | } |
| 2007 | 2007 | } |
| 2008 | 2008 | |
| 2009 | | static TIMER_CALLBACK(keyboard_callback) |
| 2009 | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 2010 | 2010 | { |
| 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");; |
| 2017 | 2017 | |
| 2018 | 2018 | if(state->cas_switch == 0) |
| 2019 | 2019 | { |
| r10318 | r10319 | |
| 2022 | 2022 | state->cur_keycode = check_keyboard_press(space->machine); |
| 2023 | 2023 | if(IRQ_LOG) printf("KEY IRQ 0x02\n"); |
| 2024 | 2024 | 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); |
| 2026 | 2026 | state->old_key1 = key1; |
| 2027 | 2027 | state->old_key2 = key2; |
| 2028 | 2028 | state->old_key3 = key3; |
| r10318 | r10319 | |
| 2034 | 2034 | if(state->cur_keycode) |
| 2035 | 2035 | { |
| 2036 | 2036 | 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); |
| 2038 | 2038 | } |
| 2039 | 2039 | } |
| 2040 | 2040 | #endif |
| r10318 | r10319 | |
| 2044 | 2044 | static MACHINE_START(pc6001) |
| 2045 | 2045 | { |
| 2046 | 2046 | 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 | | |
| 2052 | 2047 | state->timer_hz_div = 3; |
| 2053 | 2048 | { |
| 2054 | 2049 | attotime period = attotime::from_hz((487.5*4)/(state->timer_hz_div+1)); |
| r10318 | r10319 | |
| 2318 | 2313 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 2319 | 2314 | // MCFG_SOUND_WAVE_ADD("wave","cass") |
| 2320 | 2315 | // 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) |
| 2321 | 2320 | MACHINE_CONFIG_END |
| 2322 | 2321 | |
| 2323 | 2322 | |
src/mess/drivers/mycom.c
| r10318 | r10319 | |
| 464 | 464 | 0x0d,0x0d,0x38,0x28,0x49,0x69,0x4b,0x6b,0x2c,0x3c,0x39,0x39,0x36,0x36,0x33,0x33,0x12,0x12, |
| 465 | 465 | 0x07,0x07,0x39,0x29,0x4f,0x6f,0x4c,0x6c,0x2e,0x3e,0x63,0x63,0x66,0x66,0x61,0x61,0x2f,0x3f }; |
| 466 | 466 | |
| 467 | | static TIMER_CALLBACK( mycom_kbd ) |
| 467 | static TIMER_DEVICE_CALLBACK( mycom_kbd ) |
| 468 | 468 | { |
| 469 | | mycom_state *state = machine->driver_data<mycom_state>(); |
| 469 | mycom_state *state = timer.machine->driver_data<mycom_state>(); |
| 470 | 470 | UINT8 x, y, scancode = 0; |
| 471 | 471 | UINT16 pressed[9]; |
| 472 | 472 | char kbdrow[2]; |
| 473 | | UINT8 modifiers = input_port_read(machine, "XX"); |
| 473 | UINT8 modifiers = input_port_read(timer.machine, "XX"); |
| 474 | 474 | UINT8 shift_pressed = (modifiers & 2) >> 1; |
| 475 | 475 | state->keyb_press_flag = 0; |
| 476 | 476 | |
| r10318 | r10319 | |
| 478 | 478 | for (x = 0; x < 9; x++) |
| 479 | 479 | { |
| 480 | 480 | sprintf(kbdrow,"X%d",x); |
| 481 | | pressed[x] = (input_port_read(machine, kbdrow)); |
| 481 | pressed[x] = (input_port_read(timer.machine, kbdrow)); |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | /* find what has changed */ |
| r10318 | r10319 | |
| 513 | 513 | state->cassette = machine->device("cassette"); |
| 514 | 514 | state->fdc = machine->device("fdc"); |
| 515 | 515 | state->RAM = machine->region("maincpu")->base(); |
| 516 | | machine->scheduler().timer_pulse(attotime::from_hz(20), FUNC(mycom_kbd)); |
| 517 | 516 | } |
| 518 | 517 | |
| 519 | 518 | static MACHINE_RESET(mycom) |
| r10318 | r10319 | |
| 570 | 569 | /* Devices */ |
| 571 | 570 | MCFG_CASSETTE_ADD( "cassette", default_cassette_config ) |
| 572 | 571 | MCFG_WD179X_ADD("fdc", wd1771_intf) // WD1771 |
| 572 | |
| 573 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", mycom_kbd, attotime::from_hz(20)) |
| 573 | 574 | MACHINE_CONFIG_END |
| 574 | 575 | |
| 575 | 576 | /* ROM definition */ |
src/mess/drivers/x1.c
| r10318 | r10319 | |
| 674 | 674 | logerror("CMT: Command 0xe9-0x%02x received.\n",cmd); |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | | static TIMER_CALLBACK( cmt_wind_timer ) |
| 677 | static TIMER_DEVICE_CALLBACK( cmt_wind_timer ) |
| 678 | 678 | { |
| 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"); |
| 681 | 681 | |
| 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 |
| 683 | 683 | return; |
| 684 | 684 | |
| 685 | 685 | switch(state->cmt_current_cmd) |
| r10318 | r10319 | |
| 688 | 688 | case 0x05: // Fast Forwarding tape |
| 689 | 689 | cassette_seek(cmt,1,SEEK_CUR); |
| 690 | 690 | 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 |
| 692 | 692 | break; |
| 693 | 693 | case 0x04: |
| 694 | 694 | case 0x06: // Rewinding tape |
| 695 | 695 | cassette_seek(cmt,-1,SEEK_CUR); |
| 696 | 696 | if(cassette_get_position(cmt) <= 0) // at beginning? |
| 697 | | cmt_command(machine,0x01); // Stop tape |
| 697 | cmt_command(timer.machine,0x01); // Stop tape |
| 698 | 698 | break; |
| 699 | 699 | } |
| 700 | 700 | } |
| r10318 | r10319 | |
| 2240 | 2240 | } |
| 2241 | 2241 | #endif |
| 2242 | 2242 | |
| 2243 | | static TIMER_CALLBACK(keyboard_callback) |
| 2243 | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 2244 | 2244 | { |
| 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"); |
| 2252 | 2252 | |
| 2253 | 2253 | if(state->key_irq_vector) |
| 2254 | 2254 | { |
| r10318 | r10319 | |
| 2258 | 2258 | sub_io_w(space,0,0xe6); |
| 2259 | 2259 | state->irq_vector = state->key_irq_vector; |
| 2260 | 2260 | 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); |
| 2262 | 2262 | state->old_key1 = key1; |
| 2263 | 2263 | state->old_key2 = key2; |
| 2264 | 2264 | state->old_key3 = key3; |
| r10318 | r10319 | |
| 2342 | 2342 | static MACHINE_START( x1 ) |
| 2343 | 2343 | { |
| 2344 | 2344 | 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)); |
| 2347 | 2345 | |
| 2348 | 2346 | /* set up RTC */ |
| 2349 | 2347 | { |
| r10318 | r10319 | |
| 2444 | 2442 | |
| 2445 | 2443 | MCFG_FLOPPY_4_DRIVES_ADD(x1_floppy_config) |
| 2446 | 2444 | 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)) |
| 2448 | 2448 | MACHINE_CONFIG_END |
| 2449 | 2449 | |
| 2450 | 2450 | static MACHINE_CONFIG_DERIVED( x1turbo, x1 ) |
src/mess/drivers/kim1.c
| r10318 | r10319 | |
| 245 | 245 | }; |
| 246 | 246 | |
| 247 | 247 | |
| 248 | | static TIMER_CALLBACK( kim1_cassette_input ) |
| 248 | static TIMER_DEVICE_CALLBACK( kim1_cassette_input ) |
| 249 | 249 | { |
| 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") ); |
| 252 | 252 | |
| 253 | 253 | if ( tap_val <= 0 ) |
| 254 | 254 | { |
| r10318 | r10319 | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
| 269 | | static TIMER_CALLBACK( kim1_update_leds ) |
| 269 | static TIMER_DEVICE_CALLBACK( kim1_update_leds ) |
| 270 | 270 | { |
| 271 | | kim1_state *state = machine->driver_data<kim1_state>(); |
| 271 | kim1_state *state = timer.machine->driver_data<kim1_state>(); |
| 272 | 272 | int i; |
| 273 | 273 | |
| 274 | 274 | for ( i = 0; i < 6; i++ ) |
| r10318 | r10319 | |
| 287 | 287 | state_save_register_item(machine, "kim1", NULL, 0, state->u2_port_b ); |
| 288 | 288 | state_save_register_item(machine, "kim1", NULL, 0, state->_311_output ); |
| 289 | 289 | 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)); |
| 292 | 290 | } |
| 293 | 291 | |
| 294 | 292 | |
| r10318 | r10319 | |
| 339 | 337 | |
| 340 | 338 | /* video */ |
| 341 | 339 | 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)) |
| 342 | 343 | MACHINE_CONFIG_END |
| 343 | 344 | |
| 344 | 345 | |
src/mess/drivers/glasgow.c
| r10318 | r10319 | |
| 252 | 252 | state->beeper = data; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | | static TIMER_CALLBACK( update_nmi ) |
| 255 | static TIMER_DEVICE_CALLBACK( update_nmi ) |
| 256 | 256 | { |
| 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); |
| 260 | 260 | // irq_edge = ~irq_edge; |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | | static TIMER_CALLBACK( update_nmi32 ) |
| 263 | static TIMER_DEVICE_CALLBACK( update_nmi32 ) |
| 264 | 264 | { |
| 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); |
| 268 | 268 | // irq_edge = ~irq_edge; |
| 269 | 269 | } |
| 270 | 270 | |
| r10318 | r10319 | |
| 276 | 276 | mboard_key_selector = 0; |
| 277 | 277 | state->irq_flag = 0; |
| 278 | 278 | 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)); |
| 281 | 279 | beep_set_frequency(speaker, 44); |
| 282 | 280 | |
| 283 | 281 | mboard_savestate_register(machine); |
| r10318 | r10319 | |
| 290 | 288 | device_t *speaker = machine->device("beep"); |
| 291 | 289 | |
| 292 | 290 | 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)); |
| 295 | 291 | beep_set_frequency(speaker, 44); |
| 296 | 292 | |
| 297 | 293 | mboard_savestate_register(machine); |
| r10318 | r10319 | |
| 509 | 505 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 510 | 506 | MCFG_SOUND_ADD("beep", BEEP, 0) |
| 511 | 507 | 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)) |
| 512 | 511 | MACHINE_CONFIG_END |
| 513 | 512 | |
| 514 | 513 | static MACHINE_CONFIG_DERIVED( amsterd, glasgow ) |
| r10318 | r10319 | |
| 522 | 521 | MCFG_CPU_REPLACE("maincpu", M68020, 14000000) |
| 523 | 522 | MCFG_CPU_PROGRAM_MAP(dallas32_mem) |
| 524 | 523 | MCFG_MACHINE_START( dallas32 ) |
| 524 | |
| 525 | MCFG_DEVICE_REMOVE("nmi_timer") |
| 526 | MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi32, attotime::from_hz(50)) |
| 525 | 527 | MACHINE_CONFIG_END |
| 526 | 528 | |
| 527 | 529 | /*************************************************************************** |
src/mess/drivers/smc777.c
| r10318 | r10319 | |
| 590 | 590 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("_") |
| 591 | 591 | INPUT_PORTS_END |
| 592 | 592 | |
| 593 | | static TIMER_CALLBACK( keyboard_callback ) |
| 593 | static TIMER_DEVICE_CALLBACK( keyboard_callback ) |
| 594 | 594 | { |
| 595 | | smc777_state *state = machine->driver_data<smc777_state>(); |
| 595 | smc777_state *state = timer.machine->driver_data<smc777_state>(); |
| 596 | 596 | static const char *const portnames[3] = { "key1","key2","key3" }; |
| 597 | 597 | 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; |
| 599 | 599 | scancode = 0; |
| 600 | 600 | |
| 601 | 601 | for(port_i=0;port_i<3;port_i++) |
| 602 | 602 | { |
| 603 | 603 | for(i=0;i<32;i++) |
| 604 | 604 | { |
| 605 | | if((input_port_read(machine,portnames[port_i])>>i) & 1) |
| 605 | if((input_port_read(timer.machine,portnames[port_i])>>i) & 1) |
| 606 | 606 | { |
| 607 | 607 | //key_flag = 1; |
| 608 | 608 | // if(keymod & 0x02) // shift not pressed |
| r10318 | r10319 | |
| 636 | 636 | |
| 637 | 637 | for(i=0;i<0x4000;i++) |
| 638 | 638 | state->wram[i] = rom[i]; |
| 639 | | |
| 640 | | machine->scheduler().timer_pulse(attotime::from_hz(240/32), FUNC(keyboard_callback)); |
| 639 | |
| 641 | 640 | beep_set_frequency(machine->device("beeper"),300); //guesswork |
| 642 | 641 | beep_set_state(machine->device("beeper"),0); |
| 643 | 642 | } |
| r10318 | r10319 | |
| 760 | 759 | |
| 761 | 760 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 762 | 761 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) |
| 762 | |
| 763 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) |
| 763 | 764 | MACHINE_CONFIG_END |
| 764 | 765 | |
| 765 | 766 | /* ROM definition */ |
src/mess/drivers/scorpion.c
| r10318 | r10319 | |
| 262 | 262 | return address; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | | static TIMER_CALLBACK(nmi_check_callback) |
| 265 | static TIMER_DEVICE_CALLBACK(nmi_check_callback) |
| 266 | 266 | { |
| 267 | | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 267 | spectrum_state *state = timer.machine->driver_data<spectrum_state>(); |
| 268 | 268 | |
| 269 | | if ((input_port_read(machine, "NMI") & 1)==1) |
| 269 | if ((input_port_read(timer.machine, "NMI") & 1)==1) |
| 270 | 270 | { |
| 271 | 271 | 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); |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | |
| r10318 | r10319 | |
| 345 | 345 | } |
| 346 | 346 | static MACHINE_START( scorpion ) |
| 347 | 347 | { |
| 348 | | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(nmi_check_callback)); |
| 349 | 348 | } |
| 350 | 349 | |
| 351 | 350 | |
| r10318 | r10319 | |
| 416 | 415 | /* internal ram */ |
| 417 | 416 | MCFG_RAM_MODIFY(RAM_TAG) |
| 418 | 417 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 418 | |
| 419 | MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_check_callback, attotime::from_hz(50)) |
| 419 | 420 | MACHINE_CONFIG_END |
| 420 | 421 | |
| 421 | 422 | static MACHINE_CONFIG_DERIVED( profi, scorpion ) |
src/mess/drivers/mpf1.c
| r10318 | r10319 | |
| 350 | 350 | |
| 351 | 351 | /* Machine Initialization */ |
| 352 | 352 | |
| 353 | | static TIMER_CALLBACK( check_halt_callback ) |
| 353 | static TIMER_DEVICE_CALLBACK( check_halt_callback ) |
| 354 | 354 | { |
| 355 | 355 | // halt-LED; the red one, is turned on when the processor is halted |
| 356 | 356 | // 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); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | static MACHINE_START( mpf1 ) |
| r10318 | r10319 | |
| 372 | 372 | state_save_register_global(machine, state->_break); |
| 373 | 373 | state_save_register_global(machine, state->m1); |
| 374 | 374 | state_save_register_global(machine, state->lednum); |
| 375 | | |
| 376 | | machine->scheduler().timer_pulse(attotime::from_hz(1), FUNC(check_halt_callback)); |
| 377 | 375 | } |
| 378 | 376 | |
| 379 | 377 | static MACHINE_RESET( mpf1 ) |
| r10318 | r10319 | |
| 409 | 407 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 410 | 408 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| 411 | 409 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 410 | |
| 411 | MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1)) |
| 412 | 412 | MACHINE_CONFIG_END |
| 413 | 413 | |
| 414 | 414 | static MACHINE_CONFIG_START( mpf1b, mpf1_state ) |
| r10318 | r10319 | |
| 439 | 439 | MCFG_SOUND_ADD(TMS5220_TAG, TMS5220, 680000L) |
| 440 | 440 | MCFG_SOUND_CONFIG(mpf1_tms5220_intf) |
| 441 | 441 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 442 | |
| 443 | MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1)) |
| 442 | 444 | MACHINE_CONFIG_END |
| 443 | 445 | |
| 444 | 446 | static MACHINE_CONFIG_START( mpf1p, mpf1_state ) |
| r10318 | r10319 | |
| 465 | 467 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 466 | 468 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| 467 | 469 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 470 | |
| 471 | MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1)) |
| 468 | 472 | MACHINE_CONFIG_END |
| 469 | 473 | |
| 470 | 474 | /* ROMs */ |
src/mess/drivers/pcw.c
| r10318 | r10319 | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /* callback for 1/300ths of a second interrupt */ |
| 173 | | static TIMER_CALLBACK(pcw_timer_interrupt) |
| 173 | static TIMER_DEVICE_CALLBACK(pcw_timer_interrupt) |
| 174 | 174 | { |
| 175 | | pcw_state *state = machine->driver_data<pcw_state>(); |
| 175 | pcw_state *state = timer.machine->driver_data<pcw_state>(); |
| 176 | 176 | pcw_update_interrupt_counter(state); |
| 177 | 177 | |
| 178 | 178 | 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)); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /* fdc interrupt callback. set/clear fdc int */ |
| r10318 | r10319 | |
| 1118 | 1118 | state->roller_ram_offset = 0; |
| 1119 | 1119 | |
| 1120 | 1120 | /* timer interrupt */ |
| 1121 | | machine->scheduler().timer_pulse(attotime::from_hz(300), FUNC(pcw_timer_interrupt)); |
| 1122 | | |
| 1123 | 1121 | machine->scheduler().timer_set(attotime::zero, FUNC(setup_beep)); |
| 1124 | 1122 | |
| 1125 | 1123 | state->prn_stepper = machine->scheduler().timer_alloc(FUNC(pcw_stepper_callback)); |
| r10318 | r10319 | |
| 1375 | 1373 | /* internal ram */ |
| 1376 | 1374 | MCFG_RAM_ADD(RAM_TAG) |
| 1377 | 1375 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 1376 | |
| 1377 | MCFG_TIMER_ADD_PERIODIC("pcw_timer", pcw_timer_interrupt, attotime::from_hz(300)) |
| 1378 | 1378 | MACHINE_CONFIG_END |
| 1379 | 1379 | |
| 1380 | 1380 | static MACHINE_CONFIG_DERIVED( pcw8256, pcw ) |
src/mess/drivers/tk80bs.c
| r10318 | r10319 | |
| 242 | 242 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT) |
| 243 | 243 | INPUT_PORTS_END |
| 244 | 244 | |
| 245 | | static TIMER_CALLBACK( keyboard_callback ) |
| 245 | static TIMER_DEVICE_CALLBACK( keyboard_callback ) |
| 246 | 246 | { |
| 247 | | tk80bs_state *state = machine->driver_data<tk80bs_state>(); |
| 247 | tk80bs_state *state = timer.machine->driver_data<tk80bs_state>(); |
| 248 | 248 | static const char *const portnames[3] = { "key1","key2","key3" }; |
| 249 | 249 | 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; |
| 251 | 251 | scancode = 0; |
| 252 | 252 | |
| 253 | 253 | state->shift_press_flag = ((keymod & 0x02) >> 1); |
| r10318 | r10319 | |
| 256 | 256 | { |
| 257 | 257 | for(i=0;i<32;i++) |
| 258 | 258 | { |
| 259 | | if((input_port_read(machine,portnames[port_i])>>i) & 1) |
| 259 | if((input_port_read(timer.machine,portnames[port_i])>>i) & 1) |
| 260 | 260 | { |
| 261 | 261 | if(keymod & 0x04) // kana key pressed |
| 262 | 262 | { |
| r10318 | r10319 | |
| 295 | 295 | |
| 296 | 296 | static MACHINE_START(tk80bs) |
| 297 | 297 | { |
| 298 | | machine->scheduler().timer_pulse(attotime::from_hz(240/32), FUNC(keyboard_callback)); |
| 299 | 298 | } |
| 300 | 299 | |
| 301 | 300 | static MACHINE_RESET(tk80bs) |
| r10318 | r10319 | |
| 369 | 368 | |
| 370 | 369 | MCFG_VIDEO_START(tk80) |
| 371 | 370 | MCFG_VIDEO_UPDATE(tk80) |
| 371 | |
| 372 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) |
| 372 | 373 | MACHINE_CONFIG_END |
| 373 | 374 | |
| 374 | 375 | static MACHINE_CONFIG_START( tk80bs, tk80bs_state ) |
| r10318 | r10319 | |
| 394 | 395 | |
| 395 | 396 | MCFG_VIDEO_START(tk80bs) |
| 396 | 397 | MCFG_VIDEO_UPDATE(tk80bs) |
| 398 | |
| 399 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) |
| 397 | 400 | MACHINE_CONFIG_END |
| 398 | 401 | |
| 399 | 402 | /* ROM definition */ |
src/mess/drivers/fk1.c
| r10318 | r10319 | |
| 338 | 338 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 339 | 339 | INPUT_PORTS_END |
| 340 | 340 | |
| 341 | | static TIMER_CALLBACK(keyboard_callback) |
| 341 | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 342 | 342 | { |
| 343 | | fk1_state *state = machine->driver_data<fk1_state>(); |
| 343 | fk1_state *state = timer.machine->driver_data<fk1_state>(); |
| 344 | 344 | |
| 345 | | if (input_port_read(machine, "LINE0")) { |
| 345 | if (input_port_read(timer.machine, "LINE0")) { |
| 346 | 346 | 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); |
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
| r10318 | r10319 | |
| 367 | 367 | return state->int_vector * 2; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | | static TIMER_CALLBACK( vsync_callback ) |
| 370 | static TIMER_DEVICE_CALLBACK( vsync_callback ) |
| 371 | 371 | { |
| 372 | | fk1_state *state = machine->driver_data<fk1_state>(); |
| 372 | fk1_state *state = timer.machine->driver_data<fk1_state>(); |
| 373 | 373 | |
| 374 | 374 | 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); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| r10318 | r10319 | |
| 390 | 390 | |
| 391 | 391 | static MACHINE_START( fk1 ) |
| 392 | 392 | { |
| 393 | | machine->scheduler().timer_pulse(attotime::from_hz(24000), FUNC(keyboard_callback)); |
| 394 | | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(vsync_callback)); |
| 395 | 393 | } |
| 396 | 394 | |
| 397 | 395 | static VIDEO_UPDATE( fk1 ) |
| r10318 | r10319 | |
| 447 | 445 | /* internal ram */ |
| 448 | 446 | MCFG_RAM_ADD(RAM_TAG) |
| 449 | 447 | 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)) |
| 450 | 451 | MACHINE_CONFIG_END |
| 451 | 452 | |
| 452 | 453 | /* ROM definition */ |
src/mess/drivers/multi8.c
| r10318 | r10319 | |
| 395 | 395 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT) |
| 396 | 396 | INPUT_PORTS_END |
| 397 | 397 | |
| 398 | | static TIMER_CALLBACK( keyboard_callback ) |
| 398 | static TIMER_DEVICE_CALLBACK( keyboard_callback ) |
| 399 | 399 | { |
| 400 | | multi8_state *state = machine->driver_data<multi8_state>(); |
| 400 | multi8_state *state = timer.machine->driver_data<multi8_state>(); |
| 401 | 401 | static const char *const portnames[3] = { "key1","key2","key3" }; |
| 402 | 402 | 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; |
| 404 | 404 | scancode = 0; |
| 405 | 405 | |
| 406 | 406 | state->shift_press_flag = ((keymod & 0x02) >> 1); |
| r10318 | r10319 | |
| 409 | 409 | { |
| 410 | 410 | for(i=0;i<32;i++) |
| 411 | 411 | { |
| 412 | | if((input_port_read(machine,portnames[port_i])>>i) & 1) |
| 412 | if((input_port_read(timer.machine,portnames[port_i])>>i) & 1) |
| 413 | 413 | { |
| 414 | 414 | //key_flag = 1; |
| 415 | 415 | if(!state->shift_press_flag) // shift not pressed |
| r10318 | r10319 | |
| 563 | 563 | |
| 564 | 564 | static MACHINE_START(multi8) |
| 565 | 565 | { |
| 566 | | machine->scheduler().timer_pulse(attotime::from_hz(240/32), FUNC(keyboard_callback)); |
| 567 | 566 | } |
| 568 | 567 | |
| 569 | 568 | static MACHINE_RESET(multi8) |
| r10318 | r10319 | |
| 609 | 608 | |
| 610 | 609 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 611 | 610 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) |
| 611 | |
| 612 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) |
| 612 | 613 | MACHINE_CONFIG_END |
| 613 | 614 | |
| 614 | 615 | /* ROM definition */ |
src/mess/drivers/bml3.c
| r10318 | r10319 | |
| 409 | 409 | NULL /* update address callback */ |
| 410 | 410 | }; |
| 411 | 411 | |
| 412 | | static TIMER_CALLBACK( keyboard_callback ) |
| 412 | static TIMER_DEVICE_CALLBACK( keyboard_callback ) |
| 413 | 413 | { |
| 414 | | bml3_state *state = machine->driver_data<bml3_state>(); |
| 414 | bml3_state *state = timer.machine->driver_data<bml3_state>(); |
| 415 | 415 | static const char *const portnames[3] = { "key1","key2","key3" }; |
| 416 | 416 | int i,port_i,scancode; |
| 417 | 417 | scancode = 0; |
| r10318 | r10319 | |
| 420 | 420 | { |
| 421 | 421 | for(i=0;i<32;i++) |
| 422 | 422 | { |
| 423 | | if((input_port_read(machine,portnames[port_i])>>i) & 1) |
| 423 | if((input_port_read(timer.machine,portnames[port_i])>>i) & 1) |
| 424 | 424 | { |
| 425 | 425 | { |
| 426 | 426 | state->keyb_press = scancode; |
| 427 | 427 | 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); |
| 429 | 429 | return; |
| 430 | 430 | } |
| 431 | 431 | } |
| r10318 | r10319 | |
| 458 | 458 | |
| 459 | 459 | static MACHINE_START(bml3) |
| 460 | 460 | { |
| 461 | | machine->scheduler().timer_pulse(attotime::from_hz(240/8), FUNC(keyboard_callback)); |
| 462 | 461 | beep_set_frequency(machine->device("beeper"),1200); //guesswork |
| 463 | 462 | beep_set_state(machine->device("beeper"),0); |
| 464 | 463 | } |
| r10318 | r10319 | |
| 515 | 514 | |
| 516 | 515 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 517 | 516 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) |
| 517 | |
| 518 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/8)) |
| 518 | 519 | MACHINE_CONFIG_END |
| 519 | 520 | |
| 520 | 521 | /* ROM definition */ |
src/mess/drivers/junior.c
| r10318 | r10319 | |
| 169 | 169 | }; |
| 170 | 170 | |
| 171 | 171 | |
| 172 | | static TIMER_CALLBACK( junior_update_leds ) |
| 172 | static TIMER_DEVICE_CALLBACK( junior_update_leds ) |
| 173 | 173 | { |
| 174 | | junior_state *state = machine->driver_data<junior_state>(); |
| 174 | junior_state *state = timer.machine->driver_data<junior_state>(); |
| 175 | 175 | int i; |
| 176 | 176 | |
| 177 | 177 | for ( i = 0; i < 6; i++ ) |
| r10318 | r10319 | |
| 188 | 188 | { |
| 189 | 189 | junior_state *state = machine->driver_data<junior_state>(); |
| 190 | 190 | 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 ); |
| 193 | 192 | } |
| 194 | 193 | |
| 195 | 194 | |
| r10318 | r10319 | |
| 218 | 217 | MCFG_DEFAULT_LAYOUT( layout_junior ) |
| 219 | 218 | |
| 220 | 219 | MCFG_RIOT6532_ADD("riot", XTAL_1MHz, junior_riot_interface) |
| 220 | |
| 221 | MCFG_TIMER_ADD_PERIODIC("led_timer", junior_update_leds, attotime::from_hz(50)) |
| 221 | 222 | MACHINE_CONFIG_END |
| 222 | 223 | |
| 223 | 224 | |
src/mess/drivers/nanos.c
| r10318 | r10319 | |
| 328 | 328 | return 0; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | | static TIMER_CALLBACK(keyboard_callback) |
| 331 | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 332 | 332 | { |
| 333 | | nanos_state *state = machine->driver_data<nanos_state>(); |
| 333 | nanos_state *state = timer.machine->driver_data<nanos_state>(); |
| 334 | 334 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6" }; |
| 335 | 335 | |
| 336 | 336 | int i; |
| 337 | 337 | UINT8 code; |
| 338 | 338 | 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; |
| 341 | 341 | state->key_pressed = 0xff; |
| 342 | 342 | for(i = 0; i < 7; i++) |
| 343 | 343 | { |
| 344 | 344 | |
| 345 | | code = input_port_read(machine, keynames[i]); |
| 345 | code = input_port_read(timer.machine, keynames[i]); |
| 346 | 346 | if (code != 0) |
| 347 | 347 | { |
| 348 | 348 | if (i==0 && shift==0) { |
| r10318 | r10319 | |
| 416 | 416 | { |
| 417 | 417 | nanos_state *state = machine->driver_data<nanos_state>(); |
| 418 | 418 | state->key_pressed = 0xff; |
| 419 | | machine->scheduler().timer_pulse(attotime::from_hz(24000), FUNC(keyboard_callback)); |
| 420 | 419 | } |
| 421 | 420 | |
| 422 | 421 | static MACHINE_RESET(nanos) |
| r10318 | r10319 | |
| 534 | 533 | /* internal ram */ |
| 535 | 534 | MCFG_RAM_ADD(RAM_TAG) |
| 536 | 535 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 536 | |
| 537 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(24000)) |
| 537 | 538 | MACHINE_CONFIG_END |
| 538 | 539 | |
| 539 | 540 | /* ROM definition */ |
src/mess/drivers/nc.c
| r10318 | r10319 | |
| 492 | 492 | |
| 493 | 493 | |
| 494 | 494 | |
| 495 | | static TIMER_CALLBACK(dummy_timer_callback) |
| 495 | static TIMER_DEVICE_CALLBACK(dummy_timer_callback) |
| 496 | 496 | { |
| 497 | | nc_state *state = machine->driver_data<nc_state>(); |
| 497 | nc_state *state = timer.machine->driver_data<nc_state>(); |
| 498 | 498 | int inputport_10_state; |
| 499 | 499 | int changed_bits; |
| 500 | 500 | |
| 501 | | inputport_10_state = input_port_read(machine, "EXTRA"); |
| 501 | inputport_10_state = input_port_read(timer.machine, "EXTRA"); |
| 502 | 502 | |
| 503 | 503 | changed_bits = inputport_10_state^state->previous_inputport_10_state; |
| 504 | 504 | |
| r10318 | r10319 | |
| 514 | 514 | case NC_TYPE_1xx: |
| 515 | 515 | { |
| 516 | 516 | 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); |
| 518 | 518 | } |
| 519 | 519 | break; |
| 520 | 520 | |
| 521 | 521 | case NC_TYPE_200: |
| 522 | 522 | { |
| 523 | 523 | state->irq_status |= (1 << 4); |
| 524 | | nc_update_interrupts(machine); |
| 524 | nc_update_interrupts(timer.machine); |
| 525 | 525 | } |
| 526 | 526 | break; |
| 527 | 527 | } |
| r10318 | r10319 | |
| 532 | 532 | if (changed_bits & 0x02) |
| 533 | 533 | { |
| 534 | 534 | /* yes refresh memory config */ |
| 535 | | nc_refresh_memory_config(machine); |
| 535 | nc_refresh_memory_config(timer.machine); |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | state->previous_inputport_10_state = inputport_10_state; |
| r10318 | r10319 | |
| 996 | 996 | state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(nc_keyboard_timer_callback)); |
| 997 | 997 | timer_adjust_oneshot(state->keyboard_timer, attotime::from_msec(10), 0); |
| 998 | 998 | |
| 999 | | /* dummy timer */ |
| 1000 | | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(dummy_timer_callback)); |
| 1001 | | |
| 1002 | 999 | /* serial timer */ |
| 1003 | 1000 | state->serial_timer = machine->scheduler().timer_alloc(FUNC(nc_serial_timer_callback)); |
| 1004 | 1001 | } |
| r10318 | r10319 | |
| 1395 | 1392 | state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(nc_keyboard_timer_callback)); |
| 1396 | 1393 | timer_adjust_oneshot(state->keyboard_timer, attotime::from_msec(10), 0); |
| 1397 | 1394 | |
| 1398 | | /* dummy timer */ |
| 1399 | | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(dummy_timer_callback)); |
| 1400 | | |
| 1401 | 1395 | /* serial timer */ |
| 1402 | 1396 | state->serial_timer = machine->scheduler().timer_alloc(FUNC(nc_serial_timer_callback)); |
| 1403 | 1397 | } |
| r10318 | r10319 | |
| 1745 | 1739 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1746 | 1740 | |
| 1747 | 1741 | MCFG_NC_SERIAL_ADD("serial") |
| 1742 | |
| 1743 | /* dummy timer */ |
| 1744 | MCFG_TIMER_ADD_PERIODIC("dummy_timer", dummy_timer_callback, attotime::from_hz(50)) |
| 1748 | 1745 | MACHINE_CONFIG_END |
| 1749 | 1746 | |
| 1750 | 1747 | static const floppy_config nc200_floppy_config = |
| r10318 | r10319 | |
| 1793 | 1790 | /* internal ram */ |
| 1794 | 1791 | MCFG_RAM_MODIFY(RAM_TAG) |
| 1795 | 1792 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 1793 | |
| 1794 | /* dummy timer */ |
| 1795 | MCFG_TIMER_ADD_PERIODIC("dummy_timer", dummy_timer_callback, attotime::from_hz(50)) |
| 1796 | 1796 | MACHINE_CONFIG_END |
| 1797 | 1797 | |
| 1798 | 1798 | |
src/mess/drivers/z88.c
| r10318 | r10319 | |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | | static TIMER_CALLBACK(z88_rtc_timer_callback) |
| 82 | static TIMER_DEVICE_CALLBACK(z88_rtc_timer_callback) |
| 83 | 83 | { |
| 84 | | z88_state *state = machine->driver_data<z88_state>(); |
| 84 | z88_state *state = timer.machine->driver_data<z88_state>(); |
| 85 | 85 | int refresh_ints = 0; |
| 86 | 86 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" }; |
| 87 | 87 | |
| r10318 | r10319 | |
| 94 | 94 | /* any key pressed will wake up z88 */ |
| 95 | 95 | for (i=0; i<8; i++) |
| 96 | 96 | { |
| 97 | | data &= input_port_read(machine, keynames[i]); |
| 97 | data &= input_port_read(timer.machine, keynames[i]); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /* if any key is pressed, then one or more bits will be 0 */ |
| r10318 | r10319 | |
| 107 | 107 | /* column has gone low in snooze/coma */ |
| 108 | 108 | state->blink.sta |= STA_KEY; |
| 109 | 109 | |
| 110 | | cpuexec_trigger(machine, Z88_SNOOZE_TRIGGER); |
| 110 | cpuexec_trigger(timer.machine, Z88_SNOOZE_TRIGGER); |
| 111 | 111 | |
| 112 | | z88_interrupt_refresh(machine); |
| 112 | z88_interrupt_refresh(timer.machine); |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r10318 | r10319 | |
| 173 | 173 | |
| 174 | 174 | if (refresh_ints) |
| 175 | 175 | { |
| 176 | | z88_update_rtc_interrupt(machine); |
| 176 | z88_update_rtc_interrupt(timer.machine); |
| 177 | 177 | |
| 178 | 178 | /* refresh */ |
| 179 | | z88_interrupt_refresh(machine); |
| 179 | z88_interrupt_refresh(timer.machine); |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| r10318 | r10319 | |
| 299 | 299 | |
| 300 | 300 | static MACHINE_START( z88 ) |
| 301 | 301 | { |
| 302 | | machine->scheduler().timer_pulse(attotime::from_msec(5), FUNC(z88_rtc_timer_callback)); |
| 303 | 302 | } |
| 304 | 303 | |
| 305 | 304 | static MACHINE_RESET( z88 ) |
| r10318 | r10319 | |
| 775 | 774 | /* internal ram */ |
| 776 | 775 | MCFG_RAM_ADD(RAM_TAG) |
| 777 | 776 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 777 | |
| 778 | MCFG_TIMER_ADD_PERIODIC("rtc_timer", z88_rtc_timer_callback, attotime::from_msec(5)) |
| 778 | 779 | MACHINE_CONFIG_END |
| 779 | 780 | |
| 780 | 781 | |
src/mess/drivers/pcw16.c
| r10318 | r10319 | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | | static TIMER_CALLBACK(pcw16_timer_callback) |
| 139 | static TIMER_DEVICE_CALLBACK(pcw16_timer_callback) |
| 140 | 140 | { |
| 141 | | pcw16_state *state = machine->driver_data<pcw16_state>(); |
| 141 | pcw16_state *state = timer.machine->driver_data<pcw16_state>(); |
| 142 | 142 | /* do not increment past 15 */ |
| 143 | 143 | if (state->interrupt_counter!=15) |
| 144 | 144 | { |
| r10318 | r10319 | |
| 149 | 149 | |
| 150 | 150 | if (state->interrupt_counter!=0) |
| 151 | 151 | { |
| 152 | | pcw16_refresh_ints(machine); |
| 152 | pcw16_refresh_ints(timer.machine); |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| r10318 | r10319 | |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | |
| 784 | | static TIMER_CALLBACK(pcw16_keyboard_timer_callback) |
| 784 | static TIMER_DEVICE_CALLBACK(pcw16_keyboard_timer_callback) |
| 785 | 785 | { |
| 786 | | pcw16_state *state = machine->driver_data<pcw16_state>(); |
| 786 | pcw16_state *state = timer.machine->driver_data<pcw16_state>(); |
| 787 | 787 | at_keyboard_polling(); |
| 788 | 788 | if (pcw16_keyboard_can_transmit(state)) |
| 789 | 789 | { |
| r10318 | r10319 | |
| 798 | 798 | // pcw16_dump_cpu_ram(); |
| 799 | 799 | // } |
| 800 | 800 | |
| 801 | | pcw16_keyboard_signal_byte_received(machine, data); |
| 801 | pcw16_keyboard_signal_byte_received(timer.machine, data); |
| 802 | 802 | } |
| 803 | 803 | } |
| 804 | 804 | } |
| r10318 | r10319 | |
| 839 | 839 | } |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | | static TIMER_CALLBACK(rtc_timer_callback) |
| 842 | static TIMER_DEVICE_CALLBACK(rtc_timer_callback) |
| 843 | 843 | { |
| 844 | | pcw16_state *state = machine->driver_data<pcw16_state>(); |
| 844 | pcw16_state *state = timer.machine->driver_data<pcw16_state>(); |
| 845 | 845 | int fraction_of_second; |
| 846 | 846 | |
| 847 | 847 | /* halt counter? */ |
| r10318 | r10319 | |
| 1360 | 1360 | state->system_status = 0; |
| 1361 | 1361 | state->interrupt_counter = 0; |
| 1362 | 1362 | |
| 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 | | |
| 1371 | 1363 | pc_fdc_init(machine, &pcw16_fdc_interface); |
| 1372 | 1364 | |
| 1373 | 1365 | /* initialise mouse */ |
| r10318 | r10319 | |
| 1457 | 1449 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 1458 | 1450 | MCFG_INTEL_E28F008SA_ADD("flash0") |
| 1459 | 1451 | 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)) |
| 1460 | 1459 | MACHINE_CONFIG_END |
| 1461 | 1460 | |
| 1462 | 1461 | /*************************************************************************** |
src/mess/drivers/vt100.c
| r10318 | r10319 | |
| 92 | 92 | return 0; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | | static TIMER_CALLBACK(keyboard_callback) |
| 95 | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 96 | 96 | { |
| 97 | | vt100_state *state = machine->driver_data<vt100_state>(); |
| 97 | vt100_state *state = timer.machine->driver_data<vt100_state>(); |
| 98 | 98 | int i; |
| 99 | 99 | static const char *const keynames[] = { |
| 100 | 100 | "LINE0", "LINE1", "LINE2", "LINE3", |
| r10318 | r10319 | |
| 106 | 106 | if (state->key_scan) { |
| 107 | 107 | for(i = 0; i < 16; i++) |
| 108 | 108 | { |
| 109 | | code = input_port_read(machine, keynames[i]); |
| 109 | code = input_port_read(timer.machine, keynames[i]); |
| 110 | 110 | if (code!=0xff) { |
| 111 | 111 | state->keyboard_int = 1; |
| 112 | 112 | 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); |
| 114 | 114 | break; |
| 115 | 115 | } |
| 116 | 116 | } |
| r10318 | r10319 | |
| 323 | 323 | |
| 324 | 324 | static MACHINE_START(vt100) |
| 325 | 325 | { |
| 326 | | machine->scheduler().timer_pulse(attotime::from_hz(800), FUNC(keyboard_callback)); |
| 327 | 326 | } |
| 328 | 327 | |
| 329 | 328 | static MACHINE_RESET(vt100) |
| r10318 | r10319 | |
| 423 | 422 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 424 | 423 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 425 | 424 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 425 | |
| 426 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(800)) |
| 426 | 427 | MACHINE_CONFIG_END |
| 427 | 428 | |
| 428 | 429 | static MACHINE_CONFIG_DERIVED( vt180, vt100 ) |
src/mess/drivers/pc8801.c
| r10318 | r10319 | |
| 1920 | 1920 | } |
| 1921 | 1921 | } |
| 1922 | 1922 | |
| 1923 | | static TIMER_CALLBACK( pc8801_rtc_irq ) |
| 1923 | static TIMER_DEVICE_CALLBACK( pc8801_rtc_irq ) |
| 1924 | 1924 | { |
| 1925 | 1925 | if(timer_irq_mask) |
| 1926 | 1926 | { |
| 1927 | 1927 | 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); |
| 1929 | 1929 | } |
| 1930 | 1930 | } |
| 1931 | 1931 | |
| r10318 | r10319 | |
| 1942 | 1942 | static MACHINE_START( pc8801 ) |
| 1943 | 1943 | { |
| 1944 | 1944 | cpu_set_irq_callback(machine->device("maincpu"), pc8801_irq_callback); |
| 1945 | | |
| 1946 | | machine->scheduler().timer_pulse(attotime::from_hz(600), FUNC(pc8801_rtc_irq)); |
| 1947 | 1945 | } |
| 1948 | 1946 | |
| 1949 | 1947 | static MACHINE_RESET( pc8801 ) |
| r10318 | r10319 | |
| 2143 | 2141 | |
| 2144 | 2142 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 2145 | 2143 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 2144 | |
| 2145 | MCFG_TIMER_ADD_PERIODIC("rtc_timer", pc8801_rtc_irq, attotime::from_hz(600)) |
| 2146 | 2146 | MACHINE_CONFIG_END |
| 2147 | 2147 | |
| 2148 | 2148 | static MACHINE_CONFIG_DERIVED( pc8801fh, pc8801 ) |
src/mess/drivers/coleco.c
| r10318 | r10319 | |
| 220 | 220 | drvstate->last_state = state; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | | static TIMER_CALLBACK( paddle_callback ) |
| 223 | static TIMER_DEVICE_CALLBACK( paddle_callback ) |
| 224 | 224 | { |
| 225 | | coleco_state *state = machine->driver_data<coleco_state>(); |
| 225 | coleco_state *state = timer.machine->driver_data<coleco_state>(); |
| 226 | 226 | |
| 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]); |
| 228 | 228 | |
| 229 | 229 | 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); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /* Machine Initialization */ |
| r10318 | r10319 | |
| 243 | 243 | static MACHINE_START( coleco ) |
| 244 | 244 | { |
| 245 | 245 | TMS9928A_configure(&tms9928a_interface); |
| 246 | | machine->scheduler().timer_pulse(attotime::from_msec(20), FUNC(paddle_callback)); |
| 247 | 246 | } |
| 248 | 247 | |
| 249 | 248 | static MACHINE_RESET( coleco ) |
| r10318 | r10319 | |
| 317 | 316 | |
| 318 | 317 | /* software lists */ |
| 319 | 318 | MCFG_SOFTWARE_LIST_ADD("cart_list","coleco") |
| 319 | |
| 320 | MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_callback, attotime::from_msec(20)) |
| 320 | 321 | MACHINE_CONFIG_END |
| 321 | 322 | |
| 322 | 323 | static MACHINE_CONFIG_START( czz50, coleco_state ) |
| r10318 | r10319 | |
| 349 | 350 | |
| 350 | 351 | /* software lists */ |
| 351 | 352 | MCFG_SOFTWARE_LIST_ADD("cart_list","coleco") |
| 353 | |
| 354 | MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_callback, attotime::from_msec(20)) |
| 352 | 355 | MACHINE_CONFIG_END |
| 353 | 356 | |
| 354 | 357 | static MACHINE_CONFIG_DERIVED( dina, czz50 ) |
src/mess/drivers/4004clk.c
| r10318 | r10319 | |
| 124 | 124 | |
| 125 | 125 | */ |
| 126 | 126 | |
| 127 | | static TIMER_CALLBACK(timer_callback) |
| 127 | static TIMER_DEVICE_CALLBACK(timer_callback) |
| 128 | 128 | { |
| 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); |
| 131 | 131 | state->timer^=1; |
| 132 | 132 | } |
| 133 | 133 | |
| r10318 | r10319 | |
| 137 | 137 | state->timer = 0; |
| 138 | 138 | state->dac = machine->device("dac"); |
| 139 | 139 | |
| 140 | | machine->scheduler().timer_pulse(attotime::from_hz(120), FUNC(timer_callback)); |
| 141 | | |
| 142 | 140 | /* register for state saving */ |
| 143 | 141 | state_save_register_global(machine, state->timer); |
| 144 | 142 | state_save_register_global_pointer(machine, state->nixie, 6); |
| r10318 | r10319 | |
| 161 | 159 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 162 | 160 | MCFG_SOUND_ADD("dac", DAC, 0) |
| 163 | 161 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 162 | |
| 163 | MCFG_TIMER_ADD_PERIODIC("4004clk_timer", timer_callback, attotime::from_hz(120)) |
| 164 | 164 | MACHINE_CONFIG_END |
| 165 | 165 | |
| 166 | 166 | /* ROM definition */ |
src/mess/drivers/vg5k.c
| r10318 | r10319 | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
| 283 | | static TIMER_CALLBACK( z80_irq ) |
| 283 | static TIMER_DEVICE_CALLBACK( z80_irq ) |
| 284 | 284 | { |
| 285 | | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 285 | cputag_set_input_line(timer.machine, "maincpu", 0, ASSERT_LINE); |
| 286 | 286 | |
| 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)); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | static TIMER_DEVICE_CALLBACK( vg5k_scanline ) |
| r10318 | r10319 | |
| 304 | 304 | vg5k->printer = machine->device("printer"); |
| 305 | 305 | vg5k->cassette = machine->device("cassette"); |
| 306 | 306 | |
| 307 | | machine->scheduler().timer_pulse(attotime::from_msec(20), FUNC(z80_irq)); |
| 308 | | |
| 309 | 307 | state_save_register_global(machine, vg5k->ef9345_offset); |
| 310 | 308 | } |
| 311 | 309 | |
| r10318 | r10319 | |
| 440 | 438 | |
| 441 | 439 | /* Software lists */ |
| 442 | 440 | MCFG_SOFTWARE_LIST_ADD("cass_list", "vg5k") |
| 441 | |
| 442 | MCFG_TIMER_ADD_PERIODIC("irq_timer", z80_irq, attotime::from_msec(20)) |
| 443 | 443 | MACHINE_CONFIG_END |
| 444 | 444 | |
| 445 | 445 | /* ROM definition */ |
src/mess/drivers/mephisto.c
| r10318 | r10319 | |
| 316 | 316 | INPUT_PORTS_END |
| 317 | 317 | |
| 318 | 318 | |
| 319 | | static TIMER_CALLBACK( update_nmi ) |
| 319 | static TIMER_DEVICE_CALLBACK( update_nmi ) |
| 320 | 320 | { |
| 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); |
| 324 | 324 | // dac_data_w(0,state->led_status&64?128:0); |
| 325 | 325 | beep_set_state(speaker,state->led_status&64?1:0); |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | | static TIMER_CALLBACK( update_irq ) //only mm2 |
| 328 | static TIMER_DEVICE_CALLBACK( update_irq ) //only mm2 |
| 329 | 329 | { |
| 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"); |
| 332 | 332 | |
| 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); |
| 335 | 335 | |
| 336 | 336 | beep_set_state(speaker,state->led_status&64?1:0); |
| 337 | 337 | } |
| r10318 | r10319 | |
| 340 | 340 | mephisto_state *state = machine->driver_data<mephisto_state>(); |
| 341 | 341 | state->lcd_shift_counter=3; |
| 342 | 342 | |
| 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 | | |
| 346 | 343 | mboard_savestate_register(machine); |
| 347 | 344 | } |
| 348 | 345 | |
| r10318 | r10319 | |
| 352 | 349 | state->lcd_shift_counter=3; |
| 353 | 350 | state->led7=0xff; |
| 354 | 351 | |
| 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 | | |
| 358 | 352 | mboard_savestate_register(machine); |
| 359 | 353 | } |
| 360 | 354 | |
| r10318 | r10319 | |
| 397 | 391 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 398 | 392 | MCFG_SOUND_ADD("beep", BEEP, 0) |
| 399 | 393 | 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)) |
| 400 | 397 | MACHINE_CONFIG_END |
| 401 | 398 | |
| 402 | 399 | static MACHINE_CONFIG_DERIVED( rebel5, mephisto ) |
| r10318 | r10319 | |
| 412 | 409 | MCFG_CPU_REPLACE("maincpu", M65C02, 3700000) |
| 413 | 410 | MCFG_CPU_PROGRAM_MAP(mm2_mem) |
| 414 | 411 | MCFG_MACHINE_START( mm2 ) |
| 412 | |
| 413 | MCFG_DEVICE_REMOVE("nmi_timer") |
| 414 | MCFG_TIMER_ADD_PERIODIC("irq_timer", update_irq, attotime::from_hz(450)) |
| 415 | 415 | MACHINE_CONFIG_END |
| 416 | 416 | |
| 417 | 417 | |
src/mess/drivers/supercon.c
| r10318 | r10319 | |
| 513 | 513 | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | | static TIMER_CALLBACK( update_artwork ) |
| 516 | static TIMER_DEVICE_CALLBACK( update_artwork ) |
| 517 | 517 | { |
| 518 | | mouse_update(machine); |
| 518 | mouse_update(timer.machine); |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | static TIMER_CALLBACK( update_irq ) |
| r10318 | r10319 | |
| 553 | 553 | state->timer_update_irq = machine->scheduler().timer_alloc(FUNC(update_irq)); |
| 554 | 554 | timer_adjust_periodic( state->timer_update_irq, attotime::zero, 0, attotime::from_hz(1000) ); |
| 555 | 555 | |
| 556 | | machine->scheduler().timer_pulse(attotime::from_hz(20), FUNC(update_artwork)); |
| 557 | | |
| 558 | 556 | state_save_register_global_array(machine,state->save_board); |
| 559 | 557 | state_save_register_postload(machine,m_board_postload,NULL); |
| 560 | 558 | state_save_register_presave(machine,m_board_presave,NULL); |
| r10318 | r10319 | |
| 765 | 763 | MCFG_SOUND_ADD("beep", BEEP, 0) |
| 766 | 764 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 767 | 765 | |
| 768 | | |
| 766 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", update_artwork, attotime::from_hz(20)) |
| 769 | 767 | MACHINE_CONFIG_END |
| 770 | 768 | |
| 771 | 769 | /* ROM definition */ |
src/mess/drivers/avigo.c
| r10318 | r10319 | |
| 160 | 160 | /* this is not a real interrupt. This timer updates the stylus position from mouse |
| 161 | 161 | movements, and checks if the mouse button is pressed to emulate a press of the stylus to the screen. |
| 162 | 162 | */ |
| 163 | | static TIMER_CALLBACK(avigo_dummy_timer_callback) |
| 163 | static TIMER_DEVICE_CALLBACK(avigo_dummy_timer_callback) |
| 164 | 164 | { |
| 165 | | avigo_state *state = machine->driver_data<avigo_state>(); |
| 165 | avigo_state *state = timer.machine->driver_data<avigo_state>(); |
| 166 | 166 | int i; |
| 167 | 167 | int current_input_port_data[4]; |
| 168 | 168 | int changed; |
| r10318 | r10319 | |
| 172 | 172 | |
| 173 | 173 | for (i = 0; i < 4; i++) |
| 174 | 174 | { |
| 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]); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | changed = current_input_port_data[3]^state->previous_input_port_data[3]; |
| r10318 | r10319 | |
| 201 | 201 | if ((current_input_port_data[3] & 0x02)!=0) |
| 202 | 202 | { |
| 203 | 203 | /* ????? 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); |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| r10318 | r10319 | |
| 210 | 210 | state->previous_input_port_data[i] = current_input_port_data[i]; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | | nx = input_port_read(machine, "POSX"); |
| 213 | nx = input_port_read(timer.machine, "POSX"); |
| 214 | 214 | if (nx>=0x800) nx-=0x1000; |
| 215 | 215 | else if (nx<=-0x800) nx+=0x1000; |
| 216 | 216 | |
| 217 | 217 | dx = nx - state->ox; |
| 218 | 218 | state->ox = nx; |
| 219 | 219 | |
| 220 | | ny = input_port_read(machine, "POSY"); |
| 220 | ny = input_port_read(timer.machine, "POSY"); |
| 221 | 221 | if (ny>=0x800) ny-=0x1000; |
| 222 | 222 | else if (ny<=-0x800) ny+=0x1000; |
| 223 | 223 | |
| r10318 | r10319 | |
| 227 | 227 | state->stylus_marker_x +=dx; |
| 228 | 228 | state->stylus_marker_y +=dy; |
| 229 | 229 | |
| 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); |
| 231 | 231 | #if 0 |
| 232 | 232 | /* not sure if keyboard generates an interrupt, or if something |
| 233 | 233 | is plugged in for synchronisation! */ |
| r10318 | r10319 | |
| 256 | 256 | memcpy(state->previous_input_port_data, current_input_port_data, sizeof(int)*4); |
| 257 | 257 | |
| 258 | 258 | /* refresh status of interrupts */ |
| 259 | | avigo_refresh_ints(machine); |
| 259 | avigo_refresh_ints(timer.machine); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /* does not do anything yet */ |
| r10318 | r10319 | |
| 432 | 432 | |
| 433 | 433 | static MACHINE_START( avigo ) |
| 434 | 434 | { |
| 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)); |
| 438 | 435 | } |
| 439 | 436 | |
| 440 | | |
| 441 | 437 | static ADDRESS_MAP_START( avigo_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 442 | 438 | AM_RANGE(0x0000, 0x3fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank5") |
| 443 | 439 | AM_RANGE(0x4000, 0x7fff) AM_READ_BANK("bank2") AM_WRITE_BANK("bank6") |
| r10318 | r10319 | |
| 985 | 981 | /* internal ram */ |
| 986 | 982 | MCFG_RAM_ADD(RAM_TAG) |
| 987 | 983 | 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)) |
| 988 | 988 | MACHINE_CONFIG_END |
| 989 | 989 | |
| 990 | 990 | |
src/mess/drivers/svision.c
| r10318 | r10319 | |
| 24 | 24 | #define YPOS state->reg[3] |
| 25 | 25 | #define BANK state->reg[0x26] |
| 26 | 26 | |
| 27 | | |
| 28 | 27 | static TIMER_CALLBACK(svision_pet_timer) |
| 29 | 28 | { |
| 30 | 29 | svision_state *state = machine->driver_data<svision_state>(); |
| r10318 | r10319 | |
| 52 | 51 | } |
| 53 | 52 | } |
| 54 | 53 | |
| 54 | static TIMER_DEVICE_CALLBACK(svision_pet_timer_dev) |
| 55 | { |
| 56 | svision_pet_timer(timer.machine,ptr,param); |
| 57 | } |
| 58 | |
| 55 | 59 | void svision_irq(running_machine *machine) |
| 56 | 60 | { |
| 57 | 61 | svision_state *state = machine->driver_data<svision_state>(); |
| r10318 | r10319 | |
| 442 | 446 | state->svision.timer1 = machine->scheduler().timer_alloc(FUNC(svision_timer)); |
| 443 | 447 | state->pet.on = TRUE; |
| 444 | 448 | 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); |
| 446 | 449 | } |
| 447 | 450 | |
| 448 | 451 | static DEVICE_IMAGE_LOAD( svision_cart ) |
| r10318 | r10319 | |
| 551 | 554 | MCFG_SOFTWARE_LIST_ADD("cart_list","svision") |
| 552 | 555 | MACHINE_CONFIG_END |
| 553 | 556 | |
| 557 | static MACHINE_CONFIG_DERIVED( svisions, svision ) |
| 558 | MCFG_TIMER_ADD_PERIODIC("pet_timer", svision_pet_timer_dev, attotime::from_seconds(8) * 256/4000000) |
| 559 | MACHINE_CONFIG_END |
| 560 | |
| 554 | 561 | static MACHINE_CONFIG_DERIVED( svisionp, svision ) |
| 555 | 562 | MCFG_CPU_MODIFY("maincpu") |
| 556 | 563 | MCFG_CPU_CLOCK(4430000) |
| r10318 | r10319 | |
| 599 | 606 | // marketed under a ton of firms and names |
| 600 | 607 | CONS(1992, svision, 0, 0, svision, svision, svision, "Watara", "Super Vision", 0) |
| 601 | 608 | // svdual 2 connected via communication port |
| 602 | | CONS( 1992, svisions, svision, 0,svision, svisions, svisions, "Watara", "Super Vision (PeT Communication Simulation)", 0 ) |
| 609 | CONS( 1992, svisions, svision, 0,svisions, svisions, svisions, "Watara", "Super Vision (PeT Communication Simulation)", 0 ) |
| 603 | 610 | |
| 604 | 611 | CONS( 1993, svisionp, svision, 0,svisionp, svision, svision, "Watara", "Super Vision (PAL TV Link Colored)", 0 ) |
| 605 | 612 | CONS( 1993, svisionn, svision, 0,svisionn, svision, svision, "Watara", "Super Vision (NTSC TV Link Colored)", 0 ) |
src/mess/drivers/polgar.c
| r10318 | r10319 | |
| 378 | 378 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_1) |
| 379 | 379 | INPUT_PORTS_END |
| 380 | 380 | |
| 381 | | static TIMER_CALLBACK( update_nmi ) |
| 381 | static TIMER_DEVICE_CALLBACK( update_nmi ) |
| 382 | 382 | { |
| 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); |
| 387 | 387 | // dac_data_w(0,state->led_status&64?128:0); |
| 388 | 388 | // beep_set_state(speaker,state->led_status&64?1:0); |
| 389 | 389 | } |
| r10318 | r10319 | |
| 391 | 391 | |
| 392 | 392 | static MACHINE_START( polgar ) |
| 393 | 393 | { |
| 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)); |
| 397 | 394 | mboard_savestate_register(machine); |
| 398 | 395 | } |
| 399 | 396 | |
| r10318 | r10319 | |
| 440 | 437 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 441 | 438 | MCFG_SOUND_ADD("beep", BEEP, 0) |
| 442 | 439 | 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)) |
| 443 | 444 | MACHINE_CONFIG_END |
| 444 | 445 | |
| 445 | 446 | static MACHINE_CONFIG_DERIVED( milano, polgar ) |
src/mess/drivers/psion.c
| r10318 | r10319 | |
| 212 | 212 | |
| 213 | 213 | ***********************************************/ |
| 214 | 214 | |
| 215 | | static TIMER_CALLBACK( nmi_timer ) |
| 215 | static TIMER_DEVICE_CALLBACK( nmi_timer ) |
| 216 | 216 | { |
| 217 | | psion_state *state = machine->driver_data<psion_state>(); |
| 217 | psion_state *state = timer.machine->driver_data<psion_state>(); |
| 218 | 218 | |
| 219 | 219 | 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); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | UINT8 psion_state::kb_read(running_machine *machine) |
| r10318 | r10319 | |
| 678 | 678 | memory_set_bank(machine, "rambank", 0); |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | | machine->scheduler().timer_pulse(attotime::from_seconds(1), FUNC(nmi_timer)); |
| 682 | | |
| 683 | 681 | state_save_register_global(machine, m_kb_counter); |
| 684 | 682 | state_save_register_global(machine, m_enable_nmi); |
| 685 | 683 | state_save_register_global(machine, m_tcsr_value); |
| r10318 | r10319 | |
| 796 | 794 | MCFG_NVRAM_HANDLER(psion) |
| 797 | 795 | |
| 798 | 796 | MCFG_FRAGMENT_ADD( psion_slot ) |
| 797 | |
| 798 | MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_seconds(1)) |
| 799 | 799 | MACHINE_CONFIG_END |
| 800 | 800 | |
| 801 | 801 | static const UINT8 psion_4line_layout[] = |
| r10318 | r10319 | |
| 840 | 840 | MCFG_NVRAM_HANDLER(psion) |
| 841 | 841 | |
| 842 | 842 | MCFG_FRAGMENT_ADD( psion_slot ) |
| 843 | |
| 844 | MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_seconds(1)) |
| 843 | 845 | MACHINE_CONFIG_END |
| 844 | 846 | |
| 845 | 847 | static MACHINE_CONFIG_DERIVED( psioncm, psion_2lines ) |