src/mess/machine/lisa.c
| r15162 | r15163 | |
| 230 | 230 | |
| 231 | 231 | |
| 232 | 232 | /* |
| 233 | | keyboard interface |
| 233 | keyboard interface (COPS simulation; our COPS CPU core is too broken and too esoteric to emulate this correctly, I tried) |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | | |
| 237 | | |
| 238 | | |
| 239 | | |
| 240 | | |
| 241 | | |
| 242 | | |
| 243 | | |
| 244 | | |
| 245 | | |
| 246 | 236 | INLINE void COPS_send_data_if_possible(running_machine &machine) |
| 247 | 237 | { |
| 248 | 238 | lisa_state *state = machine.driver_data<lisa_state>(); |
| r15162 | r15163 | |
| 251 | 241 | |
| 252 | 242 | if ((! state->m_hold_COPS_data) && state->m_fifo_size && (! state->m_COPS_Ready)) |
| 253 | 243 | { |
| 254 | | logerror("Pushing one byte of data to VIA\n"); |
| 244 | // printf("COPsim: sending %02x to VIA\n", state->m_fifo_data[state->m_fifo_head]); |
| 255 | 245 | |
| 256 | 246 | via_0->write_porta(*space, 0, state->m_fifo_data[state->m_fifo_head]); /* output data */ |
| 257 | 247 | if (state->m_fifo_head == state->m_mouse_data_offset) |
| r15162 | r15163 | |
| 281 | 271 | #endif |
| 282 | 272 | |
| 283 | 273 | { |
| 284 | | logerror("Adding %d bytes of data to FIFO\n", len); |
| 274 | // printf("Adding %d bytes of data to FIFO\n", len); |
| 285 | 275 | |
| 286 | 276 | while (len--) |
| 287 | 277 | { |
| r15162 | r15163 | |
| 447 | 437 | /* some pull-ups allow the COPS to read 1s when the VIA port is not set as output */ |
| 448 | 438 | command = (state->m_COPS_command | (~ via_0->read(*space, VIA_DDRA))) & 0xff; |
| 449 | 439 | |
| 440 | // printf("Dropping Ready, command = %02x\n", command); |
| 441 | |
| 450 | 442 | if (command & 0x80) |
| 451 | 443 | return; /* NOP */ |
| 452 | 444 | |
| r15162 | r15163 | |
| 690 | 682 | static WRITE8_DEVICE_HANDLER(COPS_via_out_a) |
| 691 | 683 | { |
| 692 | 684 | lisa_state *state = device->machine().driver_data<lisa_state>(); |
| 693 | | state->m_COPS_command = data; |
| 685 | // printf("VIA A = %02x\n", data); |
| 686 | state->m_COPS_command = data; |
| 694 | 687 | } |
| 695 | 688 | |
| 696 | 689 | static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2) |
| r15162 | r15163 | |
| 723 | 716 | lisa_state *state = device->machine().driver_data<lisa_state>(); |
| 724 | 717 | int val = 0; |
| 725 | 718 | |
| 726 | | if (! state->m_COPS_Ready) |
| 719 | if (state->m_COPS_Ready) |
| 727 | 720 | val |= 0x40; |
| 728 | 721 | |
| 729 | 722 | if (state->m_FDIR) |