src/mess/machine/pc.c
| r2660 | r2661 | |
| 550 | 550 | int portc_switch_high; |
| 551 | 551 | int speaker; |
| 552 | 552 | int keyboard_disabled; |
| 553 | UINT8 keyb_clock; |
| 553 | 554 | UINT8 portb; |
| 554 | 555 | } pc_ppi={ 0 }; |
| 555 | 556 | |
| 556 | 557 | |
| 557 | 558 | static READ8_HANDLER (pc_ppi_porta_r) |
| 558 | 559 | { |
| 559 | | int data; |
| 560 | int data = 0xFF; |
| 560 | 561 | |
| 561 | 562 | /* KB port A */ |
| 562 | 563 | if (pc_ppi.keyboard_disabled) |
| r2660 | r2661 | |
| 574 | 575 | } |
| 575 | 576 | else |
| 576 | 577 | { |
| 577 | | data = pc_keyb_read(); |
| 578 | if ( pc_ppi.keyb_clock ) |
| 579 | { |
| 580 | data = pc_keyb_read(); |
| 581 | } |
| 578 | 582 | } |
| 579 | 583 | PIO_LOG(1,"PIO_A_r",("$%02x\n", data)); |
| 580 | 584 | return data; |
| r2660 | r2661 | |
| 652 | 656 | pc_ppi.portb = data; |
| 653 | 657 | pc_ppi.portc_switch_high = data & 0x08; |
| 654 | 658 | pc_ppi.keyboard_disabled = data & 0x80; |
| 659 | pc_ppi.keyb_clock = data & 0x40; |
| 655 | 660 | pit8253_gate_w( device_list_find_by_tag( machine->config->devicelist, PIT8253, "pit8253" ), 2, data & 1); |
| 656 | 661 | pc_sh_speaker(machine, data & 0x03); |
| 657 | | pc_keyb_set_clock(data & 0x40); |
| 662 | pc_keyb_set_clock( pc_ppi.keyb_clock ); |
| 658 | 663 | |
| 659 | 664 | cassette_change_state( image_from_devtype_and_index( IO_CASSETTE, 0 ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 660 | 665 | |