src/emu/machine/i8255.c
| r15257 | r15258 | |
| 563 | 563 | |
| 564 | 564 | |
| 565 | 565 | //------------------------------------------------- |
| 566 | | // write_pc - |
| 567 | | //------------------------------------------------- |
| 568 | | |
| 569 | | void i8255_device::write_pc(UINT8 data) |
| 570 | | { |
| 571 | | int changed = 0; |
| 572 | | |
| 573 | | // PC upper |
| 574 | | if (group_mode(GROUP_A) == MODE_0 && port_c_upper_mode() == MODE_OUTPUT) |
| 575 | | { |
| 576 | | m_output[PORT_C] = (data & 0xf0) | (m_output[PORT_C] & 0x0f); |
| 577 | | changed = 1; |
| 578 | | } |
| 579 | | |
| 580 | | // PC lower |
| 581 | | if (group_mode(GROUP_B) == MODE_0 && port_c_lower_mode() == MODE_OUTPUT) |
| 582 | | { |
| 583 | | m_output[PORT_C] = (m_output[PORT_C] & 0xf0) | (data & 0x0f); |
| 584 | | changed = 1; |
| 585 | | } |
| 586 | | |
| 587 | | if (changed) |
| 588 | | { |
| 589 | | output_pc(); |
| 590 | | } |
| 591 | | } |
| 592 | | |
| 593 | | |
| 594 | | //------------------------------------------------- |
| 595 | 566 | // output_pc - |
| 596 | 567 | //------------------------------------------------- |
| 597 | 568 | |
| r15257 | r15258 | |
| 878 | 849 | case PORT_C: |
| 879 | 850 | if (LOG) logerror("I8255 '%s' Port C Write: %02x\n", tag(), data); |
| 880 | 851 | |
| 881 | | write_pc(data); |
| 852 | m_output[PORT_C] = data; |
| 853 | output_pc(); |
| 882 | 854 | break; |
| 883 | 855 | |
| 884 | 856 | case CONTROL: |